Create 2 or more Single template and select them

Home Forums Calendar Products Events Calendar PRO Create 2 or more Single template and select them

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #19259
    Javier
    Participant

    hi there, I am wondering If I can create 2 or more single.php templates, because I need to create one normal and another one different for promotions and discounts totally diferent than the single.php one.

    And of course I need to select this template as I do with the pages template in Wp.
    Any idea?

    cheers

    #19269
    Jonah
    Participant

    Hi Javier,

    You can’t create two single.php templates but what I would suggest is to create conditional code within single.php to determine how you want to do things differently for specific events. You could for example use the is_single() (http://codex.wordpress.org/Function_Reference/is_single) conditional and pass in the ID of the event you need to target and then use specific code for just that event. Or, you could also check for whether the event is in a specific category using has_term() (http://codex.wordpress.org/Function_Reference/has_term) and use specific code for events in that category. There’s lot’s of ways to this, it’s up to you to figure out the best one for your application. But this is what I would recommend, use the single.php file and use conditional code within to insert the code you need for specific events.

    I hope that helps!

    Cheers,
    Jonah

    #19321
    Javier
    Participant

    Thanks!

    #19343
    Rob
    Member

    Thanks Jonah. Javier, I’m going to close this thread since it looks like you’ve got what you need. Let us know if we can do anything else.

    #976862
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Create 2 or more Single template and select them’ is closed to new replies.