WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
location-single.php template not working? (14 posts)

  1. scharc
    Member
    Posted 2 years ago #

    hey,

    found a couple of bugs ...

    location-single.php is not working but event-single.php in the theme dir

    -> wp-content/themes/*themeroot*/plugins/events-manager/templates

    in the admin page under settings -> pages is something wrong... it tells me, that i should create a single-event.php instead of event-single.php. same for location-single.php

    http://wordpress.org/extend/plugins/events-manager/

  2. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    could it be location-single.php doesn't work because you don't have location pages to override with formats in your settings page?

    you may be mixing things up because you can also do this in your themeroot the normal wp way

  3. scharc
    Member
    Posted 2 years ago #

    i doublechecked right now...

    i turned of the override settings for the single location page in the settings and it worked like a charm

    when i turn it back on, everything went back to the format i set up in the admin settings page

    but nothing so far for location-single.php in my theme folder...

  4. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    I mixed myself up above! in the theme folder it's single-location.php

  5. scharc
    Member
    Posted 2 years ago #

    i checked.. and there was no single-location.php in the folder which comes with the plugin...

    anyway, i copy-renamed location-single.php ... nothing

    its just taking the format in the admin panel, not the one in the theme folder

    any other things i could check?

  6. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    single-location.php is WP, not EM - http://codex.wordpress.org/Post_Types#Template_Files

    if you are modifying location-single.php i.e. from our template folder, you copy that to yourtheme/plugins/events-manager/templates/

  7. candnut
    Member
    Posted 2 years ago #

    @sharc did you manage to make it work? I still have troubles with adjusting location-single.php in templates folder in my theme. I did it with event-single.php

    What is odd is that adjusting event-sigle.php and location-single.php seems to be pretty much the same, but it just does not work. EM always pick the data from the setting page under "Single location page format" and does not replace it with the code from the template file.

    Any advice?

  8. candnut
    Member
    Posted 2 years ago #

    Ok, after hours of trying, i give up. It seems that no matter the plugin does not apply my template file for Locations:

    my_theme_folder/plugins/events-manager/templates/location-single.php

    I've no idea why. It works perfectly for event-single.php. @Marcus are you sure it is not a bug?

  9. agelonwl
    Member
    Posted 2 years ago #

    @candnut

    can you paste your code snippet? (using pastebin)

  10. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    there's a reason for this... location-single.php is now only used in MS Global tables mode.

    Any other situation, you want to create a normal CPT theme template, e.g. createa single-location.php file and put it directly in your theme folder - http://codex.wordpress.org/Post_Types#Template_Files

  11. candnut
    Member
    Posted 2 years ago #

    @Marcus thank you for your help!

    I'm not sure that MS Global Tables are. Unfortunetly I'm not that good in php and wordpress.

    I have both CPT theme template single-location.php in my theme folder with normal post loop inside (basically as it is in single.php). I've location-single.php in my_theme_folder/plugins/events-manager/templates.

    I use single-location.php to style the view of the site outside the_content();.

    This is how my location-single.php file looks like:

    <?php
    /*
     * This page displays a single event, called during the em_content() if this is an event page.
     * You can override the default display settings pages by copying this file to yourthemefolder/plugins/events-manager/templates/ and modifying it however you need.
     * You can display events however you wish, there are a few variables made available to you:
     *
     * $args - the args passed onto EM_Events::output()
     */
    global $EM_Location;
    ob_start();
    
    *** HERE IS MY NORMAL HTML CODE WITH PLACEHOLDERS ***
    
    $content = ob_get_clean();
    echo $output = $EM_Location->output($content);
    ?>

    However, still no matter what I put in location-single.php it does not overwrite the code that is in settings page under "Single location page format".

  12. candnut
    Member
    Posted 2 years ago #

    Ok I've google it and i know now what are MS Global Tables. Anyhow if I should skip the location-single.php when styling the format of single location page I still don't know how should I place placeholders in single-location.php :(

  13. aWEBthatWORKS
    Member
    Posted 2 years ago #

    I'm having the same problem, tried customizing
    wp-content/themes/*themeroot*/plugins/events-manager/templates/location-single.php
    and nothing changes. I also tried adding
    wp-content/themes/*themeroot*/single-location.php
    and
    wp-content/themes/*themeroot*/single-locations.php
    and still, can't seem to update event location page.
    Does anyone know how to solve this?

  14. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    try to see if you have locations set to show as a page, if so set it to post and see if single-location.php overrides

    will fix this as it's confusing

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic