ThemeShaper Forums » Thematic

[closed]

2nd widget in header

(5 posts)
  • Started 3 years ago by craw
  • Latest reply from mrmikeman
  • This topic is resolved

Tags:

  1. craw
    Member

    I'm trying to add another widget area to the header. This one I want to go into the "access" area

    I was successful in adding the first one with this bit of code

    // This will create your widget area
    function my_widgets_init() {
    register_sidebar(array(
    'name' => 'Header Aside',
    'id' => 'header-aside',
    'before_widget' => '<li id="%1$s" class="widgetcontainer %2$s">',
    'after_widget' => "",
    'before_title' => "<h3 class=\"widgettitle\">",
    'after_title' => "</h3>\n",
    ));

    }
    add_action( 'init', 'my_widgets_init' );

    // adding the widget area to your child theme
    function my_header_widgets() {
    if ( function_exists('dynamic_sidebar') && is_sidebar_active('header-aside') ) {
    echo '<div id="header-aside" class="aside">'. "\n" . '<ul class="xoxo">' . "\n";
    dynamic_sidebar('header-aside');
    echo '' . "\n" . '</div><!-- #header-aside .aside -->'. "\n";
    }
    }
    add_action('thematic_header', 'my_header_widgets', 8);

    I am now trying to add a second one. I have gotten to the point where I can add widgets to the area in the admin area but no dice on the actual site.

    here is the code I am using:

    // This will create your widget area
    function my_stuff_init() {
    register_sidebar(array(
    'name' => 'Header Aside2',
    'id' => 'header-aside2',
    'before_widget' => '<li id="%1$s" class="widgetcontainer %2$s">',
    'after_widget' => "",
    'before_title' => "<h3 class=\"widgettitle\">",
    'after_title' => "</h3>\n",
    ));

    }
    add_action( 'init', 'my_stuff_init' );

    // adding the widget area to your child theme
    function my_access_widgets() {
    if ( function_exists('dynamic_sidebar') && is_sidebar_active('header-aside2') ) {
    echo '<div id="header-aside2" class="aside">'. "\n" . '<ul class="xoxo">' . "\n";
    dynamic_sidebar('header-aside2');
    echo '' . "\n" . '</div><!-- #header-aside2 .aside -->'. "\n";
    }
    }
    add_action('thematic_access', 'my_access_widgets', 9);

    Here is the address to the site http://64.79.143.234/clinicient/wordpress/

    Thanks in advance for any help!

    Posted 3 years ago #
  2. craw
    Member

    I figured it out and here it is for anyone interested:

    the last line of my code needed to be "add_action('thematic_header', 'my_access_widgets', 9);"

    Posted 3 years ago #
  3. mrmikeman
    Member

    i did this same code and it dont work

    '<?php

    //

    // Custom Child Theme Functions

    //

    // I've included a "commented out" sample function below that'll add a home link to your menu

    // More ideas can be found on "A Guide To Customizing The Thematic Theme Framework"

    // http://themeshaper.com/thematic-for-wordpress/guide-customizing-thematic-theme-framework/

    // Adds a home link to your menu

    // http://codex.wordpress.org/Template_Tags/wp_page_menu

    //function childtheme_menu_args($args) {

    // $args = array(

    // 'show_home' => 'Home',

    // 'sort_column' => 'menu_order',

    // 'menu_class' => 'menu',

    // 'echo' => true

    // );

    // return $args;

    //}

    //add_filter('wp_page_menu_args','childtheme_menu_args');

    // Unleash the power of Thematic's dynamic classes

    //

    // define('THEMATIC_COMPATIBLE_BODY_CLASS', true);

    // define('THEMATIC_COMPATIBLE_POST_CLASS', true);

    // Unleash the power of Thematic's comment form

    //

    // define('THEMATIC_COMPATIBLE_COMMENT_FORM', true);

    // Unleash the power of Thematic's feed link functions

    //

    // define('THEMATIC_COMPATIBLE_FEEDLINKS', true);

    function child_remove_pagetitles() {

    // Make changes to the original function

    if (is_home() || is_front_page()) {

    $posttitle = '';

    } elseif (is_single()) {

    $posttitle = '<h1 class="entry-title">' . get_the_title() . "</h1>\n";

    //continue with original function

    } elseif (is_404()) {

    $posttitle = '<h1 class="entry-title">' . __('Not Found', 'thematic') . "</h1>\n";

    } else {

    $posttitle = '<h2 class="entry-title"><a href="';

    $posttitle .= get_permalink();

    $posttitle .= '" title="';

    $posttitle .= __('Permalink to ', 'thematic') . the_title_attribute('echo=0');

    $posttitle .= '" rel="bookmark">';

    $posttitle .= get_the_title();

    $posttitle .= "</h2>\n";

    }

    return $posttitle;

    }

    add_filter('thematic_postheader_posttitle' ,'child_remove_pagetitles')

    ?>'

    thats my functions php and i get a syntax error from adding that code

    Posted 3 years ago #
  4. you don't have a ; at the end of your last line.

    syntax error means that you are missing a ; or a } or a ) or something

    also please put all your code blocks between 2 backtick marks `
    on a US keyboard it is next to the 1 on the tilde ~ key

    Posted 3 years ago #
  5. mrmikeman
    Member

    uhgg. im sooo pathetic lol.. thank you helga!

    Posted 3 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.