1

How to change header in Wordpress Blog page and all Post pages only. I want a custom header in Blog page and all single posts page.

Thanks

2 Answers 2

3

You can use conditional tags within Wordpress:

http://codex.wordpress.org/Conditional_Tags

Basically, you will need to create the content you want only for the blog and post pages and wrap this within the conditional tags:

P.S Don't forget to include the category, and archive pages - as well as the post pages.

is_single(), is_archive(), is_category()

    <?php if (is_single()) { ?>
    // This is a post page
    <?php } else { ?>
    //This is not a post page
    <?php } ?>

Hope this helps.

2
  • No problem, could you possibly rate up my answer as a gesture in return? Thanks
    – Chris
    May 28, 2013 at 10:44
  • i have 0 reps, cant rate up
    – Arpit
    May 28, 2013 at 12:17
0

To include different header for specific pages change get_header($name) function call inside templates and add $name attribute. Wordpress will load header-{name}.php if file exists, if not, default header header.php will be loaded. Check out template hierarchy for templates where you need to change get_header() function call ( single.php, page.php ).

Wordpress documentation:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.