Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #6241
    jmcbade
    Participant

    Please give me references or tips you might be willing to share on this scenario:

    Using: WP 4.1.1, Events Maker, Polylang and ACF

    I basically seems to all work together but I want to use my own template files. I see that Events is really using a custom post type to store events and they are just customized posts.

    Can you in a nutshell, tell me how to use my own template files for events so that I can incorporate my own special fields for Events? I have leveraged the WP template hierarchy to create specialized template files for example: single-my-custom-post-type.php to display data in a way I wish. Any pointers on doing this with Event Maker please?

    *How to name them.
    *Where to place them
    *How to have Event Maker use my custom versions. On this I think what I need to do is test for say a certain category? And if it is from that category, have Event Maker use my customized template for Event Maker? So then how to I get Event Maker to use MY template file?

    Thanks

    #6242
    Bartosz
    Keymaster

    There’s a pretty simple way to do that.

    The plugin folder / templates includes all the template files the plugin is using. If you want to override any template file just copy the desired file to your theme folder. The copied file/files/folders will be used instead of the ones located in plugin folder.

    You just have to keep the folders structure. It self-explanatory, but for example if you’d like to override breadcrumbs located in global/breadcrumbs.php you have to create a folder “global” in your theme and then put breadcrumbs.php into this folder.

    You could also modify the EM template files output by using template hooks (includes/template-hooks.php) that load different parts of data in the template files, or/and pluggable template functions (includes/template-functions.php).

    In your case, you can hook into em_single_event_content action hook and display the content of ACF custom fields.

    #6270
    jmcbade
    Participant

    Ok.. I’m trying this. One thing is not clear yet. What if I want to use a conditional overide based on say a post is a member of a category(s)?

    Where do I put the code to test this? How do I then not use the override and use another template instead – either the default or another overide?

    Also, if I search this site for: “em_single_event_content” it returns not found.

    Sorry if this questions are very basic.

    #6271
    jmcbade
    Participant

    Also, if I search this site for: “em_single_event_content” it returns not found.

    Ah.. Only documented on Github. I see the example code there and this example is the kind of thing we love :)

    #6272
    jmcbade
    Participant

    Hmm.. Sorry, I’m still, if not more confused.

    This also seems undocumented: “em_single_event_classes”

    #6273
    jmcbade
    Participant

    Ok, I have got something to override:

    I copied: ” /wp-content/plugins/events-maker/templates/content-single-event.php

    to

    /wp-content/themes/twentytwelve/content-single-event.php

    Put some test code “Test Test Test” and see the test text.

    I’m looking at all these template hooks in /wp-content/plugins/events-maker/includes/template-hooks.php A couple of which are referred to already in this thread. Are these documented somewhere or do you consider them self expiatory?

    Exactly how and when to use these, parameters etc. is eluding me atm.

    Sorry if these seem like dumb questions, but I just don’t understand.

    Thanks

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.