WordPress.org

Ready to get started?Download WordPress

Forums

is_single returns true in attachement pages (5 posts)

  1. cybmeta
    Member
    Posted 11 months ago #

    Hello!!

    Using is_single() in attachment pages returns true but the documentation says that is_single() returns true "for post of any type except attachment and pages", so in attachment is_single() should return false.

    I've solved this using if(is_single() && !is_attachment) but I think this issue is either a bug or a wrong documentation.

  2. alchymyth
    The Sweeper & Moderator
    Posted 11 months ago #

    what theme are you using?

    where in the theme's files are you using the conditional statement?

    does that also happen if tested with the default theme Twenty Thirteen?

  3. cybmeta
    Member
    Posted 11 months ago #

    Hi!!

    I'm using header.php file and yes, it happens in default theme Tweny Thirteen.

  4. cybmeta
    Member
    Posted 11 months ago #

    Nobody can confirm this issue?

  5. jonnyauk
    Member
    Posted 11 months ago #

    I've just checked and can confirm that you are right - is_single() does seem to return true on attachment pages.

    If this can be confirmed by someone else, a bug report should be created at http://core.trac.wordpress.org/newticket

Reply

You must log in to post.

About this Topic

Tags