sidebar conditionals
-
Hi everybody,
I’m working on the sidebar.php file and can’t for the life of me guess what I’m doing wrong. I’m not a php pro but I can defend myself. I want a portion to display only on the home page and a page template. On everything else is should be hidden, but I don’t get this result. Can’t tell you why. Any help to clarify this would be much appreciated.
Code below:<div id="rightColB"> <a href="<?php bloginfo('rss2_url'); ?>"><img src="<?php bloginfo('template_url'); ?>/images/side-subscribe.png" class="" alt="subscrive via RSS"/></a><br /> <?php get_search_form(); ?> <img src="<?php bloginfo('template_url'); ?>/images/side-latest.png" class="sidetitle" alt="latest posts"/> <?php query_posts('showposts=10'); ?> <ul> <?php while (have_posts()) : the_post(); ?> <li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li> <?php endwhile;?> </ul> <img src="<?php bloginfo('template_url'); ?>/images/side-sites.png" class="sidetitle" alt="sites we like"/> <ul> <?php wp_list_bookmarks('title_li=&categorize=0'); ?> </ul> <?php bloginfo('url'); ?> <?php if( is_home() || is_page() ) { ?> <img src="<?php bloginfo('template_url'); ?>/images/side-flickr.png" class="sidetitle" alt="flickr photo stream"/> <div id="flickr"> <script type="text/javascript" src="http://www.flickr.com/badge_code_v2.gne?count=6&display=random&size=s&layout=y&source=user&user=36685787%40N04"></script> </div> <?php } ?> </div><!-- close RIGHTCOL-->
Viewing 1 replies (of 1 total)
-
hi
for one thing, to display code on the top page, use is_front_page() not is_home()
Viewing 1 replies (of 1 total)
The topic ‘sidebar conditionals’ is closed to new replies.