Events Calendar not showing

Home Forums Calendar Products Events Calendar PRO Events Calendar not showing

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #25138
    Tom
    Member

    Using 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!

    #25141
    Andy Fragen
    Moderator

    Try Events > Settings > Templates and select ‘Default Events Template’

    #25157
    Tom
    Member

    Thanks for the suggestion – still no good. I even double checked and re-saved my permalink settings.

    #25165
    Andy Fragen
    Moderator

    Sounds like a theme conflict. Check out Themer’s Guide.

    #25652
    Tom
    Member

    OK, 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;
    ~ }
    ~ }
    ~ ?>

    #25654
    Tom
    Member

    sorry – 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;
    }
    }
    ?>’

    #25655
    Tom
    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;
    ~ }
    ~ }
    ~ ?>

    #25656
    Tom
    Member

    Can’t seem to post the entire contents of the functions.php – how should I do so?

    #25664
    Barry
    Member

    Try using a service like Pastebin or Gist, then post the link in here.

    #25728
    Tom
    Member

    Thanks for the suggestion – try here:

    http://pastebin.com/PiVEQZsr

    #25738
    Barry
    Member

    Hi 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:

    http://pastebin.com/dvMKKs4U

    #25788
    Tom
    Member

    Cool, thanks Barry. I have amended my functions.php with the mixin function you referenced. Here is the new functions.php:

    http://pastebin.com/Z4ahssAz

    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?

    #25790
    Barry
    Member

    I’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

    #25822
    Tom
    Member

    Huzzah! 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!

    http://www.mlgma.com

    #25826
    Barry
    Member

    Excellent, glad you’ve got it up and running 🙂

Viewing 15 posts - 1 through 15 (of 16 total)
  • The topic ‘Events Calendar not showing’ is closed to new replies.