WPTouch with Events List template not working

Home Forums Calendar Products Events Calendar PRO WPTouch with Events List template not working

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #29103
    nelly
    Participant

    We are having an issue using WPTouch & Events Calendar Pro. I’m not sure how much you guys know about WP Touch, but I know you’ve looked into issues in the past, so hopefully you can help to give some insight into this issue 🙂

    We had it all set up and working properly initially, but recently noticed that the events page is no longer loading our list.php template in the events folder of our WP Touch theme. We tried updating from 2.09 to 2.10, but the issue was not resolved. I raised the issue with WP Touch and they’ve come up with a couple of workarounds, none of which we’re happy with.

    This morning I had an idea. If it’s not loading the template by itself, maybe it just needs a bit of prompting through a conditional statement. Trying to implement this as we speak, but you guys might be able to help.

    So what I’m going to do is add to the WP Touch blog loop (blog-loop.php)
    a conditional that says if is event list page -> load events/list.php, else show the blog loop.
    I have had trouble targeting the events list page (this is also split into categories, so I need all to include the category pages as well, therefore I cannot use the specific page name. What if statement do I need to target this page.

    I’ve tried a couple of things, like:

    Template here

    I’ve also tried:
    if ( (get_post_type() == 'tribe_events' && tribe_is_upcoming() && !is_single() && !is_page()))

    Both of these (as well as a couple of other different conditional statements I tried) resulted in the “Template here” showing for all of the pages, so the conditional is not working. Not sure what I’m doing wrong.

    Any help would be hugely appreciated!

    #29104
    nelly
    Participant

    Not sure what happened with the first code block. This is the code below that I tried first:

    list.php Template here

    Blog loop here

    #29105
    nelly
    Participant

    sorry, just realisedit doesn’t like the greater than sign with php. One more try 🙂
    <?php
    if ( (get_post_type() == 'tribe_events' && tribe_is_upcoming() && !is_single() && !is_page('things-to-do-in-brisbane-with-kids'))) { ?>
    Template here
    <?php } else { ?>

    #29107
    nelly
    Participant

    The first one I tried was:
    if ( (get_post_type() == 'tribe_events' && tribe_is_upcoming() )

    #29110
    nelly
    Participant

    Sorry for all the posts, just thought it would help if you knew what I’d tried. I also just tried
    if(tribe_is_upcoming()){
    This adds “template here” for all of the pages also.

    #29126
    Barry
    Member

    Hi ngaire, I am not at all familiar with WP Touch.

    If I understand things correctly though, it’s rather atypical insofar as the “theme” is contained within the plugin. So it’s quite possible our template loader is coming a cropper there.

    The other problem is that there is a current bug where tribe_is_upcoming() erroneously returns the wrong boolean value depending on where it is used (and this should be fixed soon).

    Though not ideal, you may be better off testing against the requested URL to check if it contains events/upcoming as a means of detecting if the list.php template is going to be required.

    #29154
    nelly
    Participant

    Thanks for that Barry. I was hoping to keep away from using the URL, but it looks like it’s the best way until you guys have implemented the fix for tribe_is_upcoming(). I will revisit this again then.

    For anyone else that comes across this problem here is the workaround I’ve used:
    <?php
    $uri = $_SERVER["REQUEST_URI"];
    $uri_array = split("/",$uri);
    $uri_first = $uri_array[1]; // might need to change this to [1]
    ?>
    <?php if ($uri_first == 'event-list-page-here'){ ?>
    <?php require_once(ABSPATH. '/wp-content/wptouch-data/themes/classic-child-1/iphone/list.php'); ?>
    <?php } else { ?>

    Thanks

    #29159
    Barry
    Member

    Yep, it’s not ideal but it does give you a functional workaround.

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘WPTouch with Events List template not working’ is closed to new replies.