Home › Forums › Calendar Products › Events Calendar PRO › WPTouch with Events List template not working
- This topic has 7 replies, 2 voices, and was last updated 11 years, 4 months ago by Barry.
-
AuthorPosts
-
December 6, 2012 at 6:35 pm #29103nellyParticipant
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!
December 6, 2012 at 6:37 pm #29104nellyParticipantNot sure what happened with the first code block. This is the code below that I tried first:
list.php Template here
Blog loop here
December 6, 2012 at 6:40 pm #29105nellyParticipantsorry, 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 { ?>December 6, 2012 at 7:24 pm #29107nellyParticipantThe first one I tried was:
if ( (get_post_type() == 'tribe_events' && tribe_is_upcoming() )
December 6, 2012 at 7:39 pm #29110nellyParticipantSorry 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.December 7, 2012 at 7:43 am #29126BarryMemberHi 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.
December 7, 2012 at 8:06 pm #29154nellyParticipantThanks 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
December 8, 2012 at 6:45 am #29159BarryMemberYep, it’s not ideal but it does give you a functional workaround.
-
AuthorPosts
- The topic ‘WPTouch with Events List template not working’ is closed to new replies.