With the get_header() function, if I have an header.php and an header-news.php, can I use the second file only when a single post of the nesw category is displayed? I have a one page wordpress website where the only page will be the news category archive and the sigle news categorized posts that are using the single.php file template. The menu links are anchor tags so if the user navigate away from home by clicking on a news, I need that the menu can redirect it back to the home where all the contents are published. Also I need some suggestion on how to paginate my category archive. Thanks in advance.

1 Answer 1


Please try this header in single.php

<?php get_header('news'); ?>

let me know if still facing the issue.

  • It wasn't really an issue, I've asket to be sure that I can do the same you did in the answer, I've used this trick only one time for a woocommerce custom theme and it worked. Thanks for the help
    – sialfa
    May 5, 2020 at 13:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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