WordPress.org

Ready to get started?Download WordPress

Forums

Whats The Condtional Tag For Single Pages? (3 posts)

  1. WP Sites - Brad Dalton
    Member
    Posted 1 year ago #

    I thought it was is_page but that also returns true for archives pages.

    I only need single pages without effecting archives page or any other page template.

  2. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    I thought it was is_page but that also returns true for archives pages.

    if this happens in your site, then there is possibly something wrong with the main query or any custom query used in your archives page;
    page templates will of course return true for is_page() - so you might need to add further checks...

    http://codex.wordpress.org/Conditional_Tags

    please post more details, for instance a link to your site.

  3. WP Sites - Brad Dalton
    Member
    Posted 1 year ago #

    I think i also need to add these as well

    if (is_page && !is_page_template() && !is_archive() && !is_category() )

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.