WordPress.org

Ready to get started?Download WordPress

Forums

Problems with is_home() and is_single() (3 posts)

  1. thinkdj
    Member
    Posted 5 years ago #

    Hey guys

    is_home() returns true in index.php and single.php and is_single() returns false in both cases...
    Any idea why ?

  2. Webstractions
    Member
    Posted 5 years ago #

    I am having the same problem. But, with is_home() and is_front_page(), both of which are returning true in my sidebar.php file. Oddly enough, the is_home() functions properly in a nav.php file (for classing the link as current).

    Cannot figure out what is up. I am using the latest version of WP 2.7

    Here is the code I am using to limit the blogroll to appear only on the home page:

    <pre><code><?php if( is_front_page() ) :?>
          <li class="widget">
             <h3>Blogroll</h3>
             <ul>
            <?php  wp_list_bookmarks('title_li=&categorize=0'); ?>
             </ul>
          </li>
    <?php endif; ?>

    The blogroll is appearing on every page.

  3. derektop
    Member
    Posted 5 years ago #

    I'm having the same problem with is_single in my sidebar.php ... did you figure out a fix?

Topic Closed

This topic has been closed to new replies.

About this Topic