php - Wordpress Sidebar Not Showing -


hi creating new theme in wordpress.

having prob sidebar, should display main parent title children.

<?php if ( !function_exists('register_sidebar')|| !register_sidebar() ) : ?>     <ul id="sidebar">         <?php         if($post->post_parent){             $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0");             $title_heading = get_the_title($post->post_parent);         } else {             $children = wp_list_pages("title_li=&child_of=".$post->id."&echo=0");             $title_heading = get_the_title($post->id);         }          if($children) { ?>          <li><h3><?php echo $title_heading; ?> </h3>             <ul>                 <?php echo $children; ?>             </ul></li>         <?php } ?>     </ul>     <?php endif; // end primary widget area ?> 

but not displaying anything.

it shows sidebar div in firebug displaying sidebar.

its on localhost cant give url.

all appreciated

cheers joe

i can see 1 of 2 problems:

  1. you have sidebar registered, means condition passed , it's trying use widgetized sidebar; not have widgets in sidebar not showing anything. (in other words, if have sidebar, above code never display anyhow).

  2. you not have sidebar registered, it's passing condition. however, next conditions not passed because they're not met or because loop hasn't triggered yet , not have access variables.

quick , cheap way see if conditions met echo out plain text or markup inside each condition:

... if($post->post_parent){    echo('parent found'); ... 

(for example)


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -