• Resolved gabon

    (@gabon)


    Hi guys, I’d like to generate a different header based on the type of the page (for instance index, archive or page), how can I get that info? Thanks, chr

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter gabon

    (@gabon)

    I’m trying with is_page() but it seems not readable from there.

    Thread Starter gabon

    (@gabon)

    ok, I had to test with is_single(). So it’s solved. Cheers!

    if (is_archive()) // if displaying any archive
    elseif (is_page()) // if displaying a wp Page (write -> page)
    elseif (is_single()) // if displaying single post
    else // everyting else

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Get page type in header.php’ is closed to new replies.