• dawnted

    (@dawnted)


    I currently have different templates for all the different categories in my blog. This is achieved by using the following code in my archive page:

    if (in_category('20'))
      {
      	   include(TEMPLATEPATH.'/archive-business-and-administration.php');

    etc

    I want to assign a different template to one of the categories on posts after a certain date. I presume this can be done in one of two ways but I’ve been away from the coding side of wordpress for so long I cannot fathom out how to go about either!

    Idea 1. create another attribute within the if statement to say something along the lines of ‘if created before January 2015 use template 1 else use template 2’

    Idea 2. In the particular template page I currently have assigned to the category, I could perhaps use code to show or hide a logo dependent on the date (This is the only difference I need in the two templates).

    I think idea 2 is probably the most simple and the one I would prefer to do but I am unsure how to go about it.

    Any help or link to where to find what I need is most appreciated.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Show a particular template for category dependent on date’ is closed to new replies.