Home › Forums › Calendar Products › Events Calendar PRO › Events Calendar not showing
- This topic has 15 replies, 4 voices, and was last updated 10 years, 9 months ago by
Support Droid.
-
AuthorPosts
-
September 14, 2012 at 3:36 pm #25138
Tom
MemberUsing Events Calendar 2.08 in a child theme for Theme Hybrid 1.0 (http://themehybrid.com/themes/hybrid).
When I revert to an unmodified twentyeleven theme, events show up fine on both the calendar and individual posts.
when I use my child theme, there is no calendar (http://www.mlgma.com/events/), events don’t show up in any widgets, but they DO show up on individual event posts (http://www.mlgma.com/event/july-test/). Of course you will see there are other things not brought in by the style sheets.
Struggling a bit here, as this is my first foray into modifying a WordPress site like this.
Thanks for any and all feedback!
September 14, 2012 at 4:02 pm #25141Andy Fragen
ModeratorTry Events > Settings > Templates and select ‘Default Events Template’
September 14, 2012 at 6:30 pm #25157Tom
MemberThanks for the suggestion – still no good. I even double checked and re-saved my permalink settings.
September 15, 2012 at 8:49 am #25165Andy Fragen
ModeratorSounds like a theme conflict. Check out Themer’s Guide.
September 24, 2012 at 7:11 pm #25652Tom
MemberOK, I think I have it narrowed down to functions.php…
1) I am using the plugin Custom Post Type UI to allow the business to create Newsletters.
2) To get these to show up on the home page, I had to create a custom functions.php.
3) If I remove or comment out the functions in my custom functions.php, the Calendar shows correctly – hooray! but then, of course, my customer’s custom posts don’t display as posts on the news page.This is the content of my functions.php. I would love some help.
~ query_vars[‘suppress_filters’] )
~ /* $query->set( ‘post_type’, array( ‘post’, ‘tribe_events’, ‘attachment’ ) );
~ /* return $query;
~ /* }
~ */
~
~ add_filter( ‘pre_get_posts’, ‘mlgma_my_get_posts’ );
~ function mlgma_my_get_posts( $query ) {
~ if ( is_home() && false == $query->query_vars[‘suppress_filters’] )
~ $query->set( ‘post_type’, array( ‘post’, ‘Newsletter’, ‘attachment’ ) );
~ return $query;
~ }
~ }
~ ?>September 24, 2012 at 7:26 pm #25654Tom
Membersorry – didn’t include the entire contents:
‘query_vars[‘suppress_filters’] )
/* $query->set( ‘post_type’, array( ‘post’, ‘tribe_events’, ‘attachment’ ) );
/* return $query;
/* }
*/add_filter( ‘pre_get_posts’, ‘mlgma_my_get_posts’ );
function mlgma_my_get_posts( $query ) {
if ( is_home() && false == $query->query_vars[‘suppress_filters’] )
$query->set( ‘post_type’, array( ‘post’, ‘Newsletter’, ‘attachment’ ) );
return $query;
}
}
?>’September 24, 2012 at 7:28 pm #25655Tom
Member~ query_vars[‘suppress_filters’] )
~ /* $query->set( ‘post_type’, array( ‘post’, ‘tribe_events’, ~ ‘attachment’ ) );
~ /* return $query;
~ /* }
~ */
~ add_filter( ‘pre_get_posts’, ‘mlgma_my_get_posts’ );
~ function mlgma_my_get_posts( $query ) {
~ if ( is_home() && false == ~$query->query_vars[‘suppress_filters’] )
~ $query->set( ‘post_type’, array( ‘post’, ~’Newsletter’, ‘attachment’ ) );
~ return $query;
~ }
~ }
~ ?>September 24, 2012 at 7:29 pm #25656Tom
MemberCan’t seem to post the entire contents of the functions.php – how should I do so?
September 25, 2012 at 5:52 am #25664Barry
MemberTry using a service like Pastebin or Gist, then post the link in here.
September 25, 2012 at 7:17 pm #25728Tom
MemberThanks for the suggestion – try here:
September 26, 2012 at 6:39 am #25738Barry
MemberHi again Tom, thanks for that. We do have a number of forum improvements in the works and one of those centres on making it easier to post code in here – however for the time being Pastebin/Gist etc offer the best chance of successfully sharing code here.
Anyway, to the problem at hand, one part of the puzzle could be that is_home() erroneously returns true on pages such as the main events page, so it could be that your code is inadvertently fouling the main Events Calendar query since you are modifying the query whenever the following condition is satisfied:
( is_home() && false == $query->query_vars['suppress_filters'] )I’m borrowing the following snippet from a different thread however if you look at the first line inside the function you will see one way of working around this problem:
September 27, 2012 at 7:21 am #25788Tom
MemberCool, thanks Barry. I have amended my functions.php with the mixin function you referenced. Here is the new functions.php:
Now, however, my custom posts of type ‘Newsletter’ don’t display properly, so I had to return to the old functions file for now.
Please forgive my lack of education – I don’t understand all the syntax. How would I edit the function referenced here: http://pastebin.com/mmpxj5pJ to properly include Newsletters while at the same time not excluding events?
September 27, 2012 at 7:48 am #25790Barry
MemberI’m working blind a little, since I don’t have your custom post type code so this is completely untested – but you might be looking for something closer to this: http://pastebin.com/595Be8GG
September 27, 2012 at 2:10 pm #25822Tom
MemberHuzzah! That did it – Thanks, Barry! I didn’t understand the parameters in the parentheses were basically performing an OR for the query. Works like a champ, and cleaned up my code! Thanks again!
September 27, 2012 at 3:21 pm #25826Barry
MemberExcellent, glad you’ve got it up and running 🙂
-
AuthorPosts
- The topic ‘Events Calendar not showing’ is closed to new replies.
