WordPress.org

Ready to get started?Download WordPress

Forums

is_single() disabled? somehow? (6 posts)

  1. fireundubh
    Member
    Posted 6 years ago #

    The is_single() function is not working in my theme for whatever reason.

    <?php if(is_single()): ?>
    <?php include(TEMPLATEPATH . '/footer2.php'); ?>
    <?php else: ?>
    <?php get_footer(); ?>
    <?php endif; ?>

    That just doesn't work... The page executes as though there were no conditions and seems to skip directly to get_footer(). (I've tested this with and without single.php.)

    If I were to guess, I'd say that WordPress simply isn't classifying posts in a way that is_single() can identify.

  2. Douglas Karr
    Member
    Posted 6 years ago #

    I am having the same problem, I can not get is_single to work in any way.

  3. Kafkaesqui

    Posted 6 years ago #

    It would help to examine the source of the template(s) this is used in. For example, is there any instance of query_posts() in it, which can whack conditional query properties.

  4. Douglas Karr
    Member
    Posted 6 years ago #

    My theme is just a modified WordPress Default theme. I don't use query_posts anywhere in the theme.

  5. Kafkaesqui

    Posted 6 years ago #

    Then what:

    1. version of WordPress is used.
    2. template is_single() occuring in.
    3. is the code for the if statement.

    Also, do any other Conditional Tags work for you?

  6. aarrgg
    Member
    Posted 6 years ago #

    I had the same problem (i think). To me it solved when I reinstalled the theme. I still don't know what caused it but it works fine now.

Topic Closed

This topic has been closed to new replies.

About this Topic