Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

i created a taxonomy page from archive.php , working based on thematic frame work. i tried a lot to make the sidebar working but it show nothing and even using firebug its not exist !

<?php
/**
 * Template Name: MEDIT
 *
 * …
 * 
 * @package Thematic
 * @subpackage Templates
 */

    // calling the header.php
    get_header();

    // action hook for placing content above #container
    thematic_abovecontainer();
?>

        <div id="container">

                <?php
                // action hook for placing content above #content
                    thematic_abovecontent();

                // filter for manipulating the element that wraps the content 
                    echo apply_filters( 'thematic_open_id_content', '<div id="content">' . "\n" );
                    ?>

                    <?php
                    $term_slug = get_query_var( 'term' );
                    $taxonomyName = get_query_var( 'taxonomy' );
                    $current_term = get_term_by( 'slug', $term_slug, $taxonomyName );
                    $args = array( 'child_of' => $current_term->term_id, 'hide_empty'=>false);
                    $terms = get_terms( 'tagportifolio', $args);
                    $assoc = taxonomy_image_plugin_get_associations();

                    if (!empty($terms)):
                ?>
                    <?php /*?><?php
                    // calling the standard sidebar 
                    dynamic_sidebar('cs-project-main-category');
                    ?><?php */?>
                    <?php foreach( $terms as $child ): ?>
                        <?php thematic_abovepost(); ?>
                        <div id="cat-<?php echo $child->term_id; ?>">
                        <?php
                            if(array_key_exists( $child->term_taxonomy_id, $assoc )){
                                 echo wp_get_attachment_image( $assoc[$child->term_taxonomy_id], array(), false, 'thumbnail');
                             }
                        ?>

                        <h1 class="entry-title"><a href="<?php echo get_term_link( $child->name, $taxonomyName );?>">
                        <?php echo $child->name; ?></a ></h1><br/>
                        </div>

                        <?php thematic_belowpost();?>

                        <?php endforeach; ?>

                        <?php 
                            else: 
                            // start the loop
                        ?>
                        <?php /*?><?php
                        // calling the standard sidebar 
                        dynamic_sidebar('cs-sub-cat-sidebar');
                        ?><?php */?>
            <!--</div> #content -->

            <?php 
            endif;
            ?> 
            <?php
                // action hook for placing content below #content
                thematic_belowcontent();
            ?>          
        </div><!-- #container -->

<?php 
    // action hook for placing content below #container
    thematic_belowcontainer();

    // calling the standard sidebar 
    thematic_sidebar();

    // calling footer.php
    get_footer();
?>

any idea what is missing in my code please ?

share|improve this question
    
which sidebar are you trying to show? thematic_sidebar()? both of your calls to dynamic_sidebar are commented out. –  Milo Aug 6 '12 at 13:50
    
yes thematic_sidebar not the others –  Rasha Nour Eldin Aug 6 '12 at 14:04
add comment

2 Answers

It working now this is the right template with the code i should use Thanks for help

<?php
/**
 * Archive Template 
 *
 * Displays an Archive index of post-type items. Other more specific archive templates 
 * may override the display of this template for example the category.php.
 *
 * @package Thematic
 * @subpackage Templates
 *
 * @link http://codex.wordpress.org/Template_Hierarchy Codex: Template Hierarchy
 */

    // calling the header.php
    get_header();

    // action hook for placing content above #container
    thematic_abovecontainer();
?>

        <div id="container">

        <?php 
            // action hook for placing content above #content
            thematic_abovecontent();

            // filter for manipulating the element that wraps the content 
            echo apply_filters( 'thematic_open_id_content', '<div id="content">' . "\n\n" ); 
                    $term_slug = get_query_var( 'term' );
                    $taxonomyName = get_query_var( 'taxonomy' );
                    $current_term = get_term_by( 'slug', $term_slug, $taxonomyName );
                    $args = array( 'child_of' => $current_term->term_id, 'hide_empty'=>false);
                    $terms = get_terms( 'tagportifolio', $args);
                    $assoc = taxonomy_image_plugin_get_associations();

                    if (!empty($terms)):
                    foreach( $terms as $child ):
                    ?>
                    <div id="cat-<?php echo $child->term_id; ?>">
                        <?php
                            if(array_key_exists( $child->term_taxonomy_id, $assoc )){
                                 echo wp_get_attachment_image( $assoc[$child->term_taxonomy_id], array(), false, 'thumbnail');
                             }
                        ?>

                        <h1 class="entry-title"><a href="<?php echo get_term_link( $child->name, $taxonomyName );?>">
                        <?php echo $child->name; ?></a ></h1><br/>
                       </div>
                       <?php
                        endforeach;
                        endif;
                        ?>

            </div><!-- #content -->

            <?php 
                // action hook for placing content below #content
                thematic_belowcontent(); 
            ?> 

        </div><!-- #container -->

<?php 
    // action hook for placing content below #container
    thematic_belowcontainer();

    // calling the standard sidebar 
    thematic_sidebar();

    // calling footer.php
    get_footer();
?>
share|improve this answer
add comment

If you have named your sidebar file sidebar.php then you should use get_sidebar() and not thematic_sidebar(). Do you use thematic_sidebar() on other template files and does this work?

EDIT

Wanted to help you debug so I have edited my answer

ok downloaded thematic and installed in local IDE,

thematic_sidebar(){ 

$show = TRUE;
    $show = apply_filters('thematic_sidebar', $show);

    if ($show)
        get_sidebar();

    return; 
}   

One way to test this since you are developing online is to echo statements to confirm if you get into the function

e.g. echo '<div>You made it into the sidebar function</div>';

Place this at the top above $show = TRUE;

If this does not echo then you will have to test previous functions, if it does then the path to your sidebar.php file may be broken. Tested locally and the echo works so give it a try, copy and paste the code into your sidebar and check, try it in other functions just to ensure these are being executed. Hope this helps

share|improve this answer
    
yes i am working on thematic child theme , that based on thematic framework –  Rasha Nour Eldin Aug 6 '12 at 14:04
    
ok apologies, are you developing locally? This will allow you to step through the code until you get to your function call for thematic_sidebar(), if your footer is showing then that is a good indication that it has made it passed the thematic_sidebar() function but it didn't execute correctly, if you are developing locally try to look at variables created in an IDE environment –  thirdOctet Aug 6 '12 at 14:14
    
no i develop online integritycorp.org/study/portifolio/urbandesign –  Rasha Nour Eldin Aug 6 '12 at 14:19
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.