WordPress.org

Forums

is_single returns true in attachement pages (5 posts)

  1. cybmeta
    Member
    Posted 1 year 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
    Forum Moderator
    Posted 1 year 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 1 year ago #

    Hi!!

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

  4. cybmeta
    Member
    Posted 1 year ago #

    Nobody can confirm this issue?

  5. jonnyauk
    Member
    Posted 1 year 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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags