• I’ve been searching these forums and elsewhere for a couple of hours to no avail, yet I don’t feel my problem is a particularly complex one.

    I have two blog pages on my site and 2 post categories. I want all posts from one category appearing on one blog and the other category on the other blog.

    The two blogs are each a different template file, so the solution which is readily available on various tutorial sites – adding custom PHP to the functions.php file – is not sufficient (because the functions.php file won’t ‘redeclare’ the same function twice with a different variable each time).

    So I believe what I need to do is add the code which will exclude the necessary category directly into each of the two blog template files.

    Can anyone help with the necessary code and its positioning?

    Many thanks.

The topic ‘Exclude Post Categories From Template File Using PHP Function’ is closed to new replies.