help with event calendar on hueman template
-
Hello, by far hueman is the best template for what i’m trying to do.
But the only problem is that the events plug-ins are working badly only at that template. I tryed different one and it worked,The problem is that the plugin creates a event.. and this event was suposed to show itself at the blog page as a ‘post’
but at hueman template this is not happening.what can i do? please,
-
Hi insept. Welcome to the Hueman forum. You didn’t say specifically which event plugin you are using. Based on your other post I’m assuming it’s The Events Calendar plugin. If so, you might take a look at this post on their support forum:
https://theeventscalendar.com/support/forums/topic/events-n-main-loop-tribe-events-and-regular-posts-what-happns-w-past-events/If that doesn’t work then you might try adding the tribe event post type in the main query by creating a function in a child theme functions.php file. If you’re not currently using a child theme you can install one with these steps:
1. In Theme Options click the Help tab in the upper righthand corner.
2. One of the options in the list is to download a sample child theme. This downloads the theme zip file to your local computer.
3. Install the new theme in your Admin panel by selecting Add New > Upload Theme > Choose File, then select the zip file you downloaded.
4. Activate the child theme.
You’ll now have a pre-configured child theme with a style.css file and functions.php file to which you can add customizations.In the child theme functions.php file, create a function that adds the event post type to the query:
// add Tribe Event post type to main query add_action('pre_get_posts','insept_query_filter'); function insept_query_filter($query) { if ( !is_admin() && $query->is_main_query() ) { $query->set('post_type', array( 'post', 'tribe_event' ) ); } }
Hello Bdbrown,
thanks for your kind instructions.I followed your steps,
(i′m not sure how to activate the child theme, but I added the text that you wrote to my function.php
no good results.Can you say what happened?
the site is https://www.useindaiatuba.org.brRegards ??
i′m not sure how to activate the child theme
Admin menu > Appearance > Themes, hover over the child theme and select Activate.
I see, now i followed right, but after i copied the code at the function.php a message shows up everytime
Fatal error: Cannot redeclare insept_query_filter() (previously declared in /home/usein027/public_html/wp-content/themes/hueman-child-master/functions.php:12) in /home/usein027/public_html/wp-content/themes/hueman/functions.php on line 839
i cant edit it anymore, do you know what happened?
————————
i fixed! no more messages
————————but the code didn′t work, i can′t see the events at this page
can you see whats is going on?The featured post configuration uses it’s own query to populate the slider, so you need to modify the related theme file.
1. Copy /inc/featured.php from the parent theme to the same path in your child theme.
2. This is the query at the top of the file:
<?php // Query featured entries $featured = new WP_Query( array( 'no_found_rows' => false, 'update_post_meta_cache' => false, 'update_post_term_cache' => false, 'ignore_sticky_posts' => 1, 'posts_per_page' => ot_get_option('featured-posts-count'), 'cat' => ot_get_option('featured-category') ) ); ?>
3. Add the post_type as the first query argument:
<?php // Query featured entries $featured = new WP_Query( array( 'post_type' => array( 'post', 'tribe_event' ), 'no_found_rows' => false, 'update_post_meta_cache' => false, 'update_post_term_cache' => false, 'ignore_sticky_posts' => 1, 'posts_per_page' => ot_get_option('featured-posts-count'), 'cat' => ot_get_option('featured-category') ) ); ?>
first of all thank you so much, but didn’t work so far.
I followed the steps but so far, i cant see the events on the blog or post page..see how is my code at function.php and featured.php
// add Tribe Event post type to main query add_action('pre_get_posts','sept_query_filter'); function sept_query_filter($query) { if ( !is_admin() && $query->is_main_query() ) { $query->set('post_type', array( 'post', 'tribe_event' ) ); } }
and
<?php // Query featured entries $featured = new WP_Query( array( 'post_type' => array( 'post', 'tribe_event' ), 'no_found_rows' => false, 'update_post_meta_cache' => false, 'update_post_term_cache' => false, 'ignore_sticky_posts' => 1, 'posts_per_page' => ot_get_option('featured-posts-count'), 'cat' => ot_get_option('featured-category') ) ); ?>
In Theme Options > Blog, what are your settings for:
1. Include featured posts in content area
2. Featured Category
3. Featured Post CountIn Settings > Reading, what are your settings for:
1. Front page displays
2. Blog pages show at most __ postsIn Theme Options > Blog, my settings are:
1. Include featured posts in content área = was NO, I changed for YES
2. Featured Category = selectone, i didnt find ′events′there
3. Featured Post Count = 10 (max)In Settings > Reading, what are your settings for:
1. Front page displays = recently posts
2. Blog pages show at most 10 postsHow many posts do you have? How many events?
only 1 post by now, and 2 events, ??
When I look at the Eventos page on the site you linked above I see three events:
2/17/16: Mais um
2/20/16: outro teste
2/28/16: Palestra – Antrei Moreira
All of them return a “404 Page Not Found” error. You probably need to correct that first.I don′t know what happened to have this message 404…
I tried everything..
i removed the code that you sent to me, and now it′s working// add Tribe Event post type to main query add_action('pre_get_posts','sept_query_filter'); function sept_query_filter($query) { if ( !is_admin() && $query->is_main_query() ) { $query->set('post_type', array( 'post', 'tribe_event' ) ); } }
Try this which should limit the change to the home page:
// add Tribe Event post type to main query add_action('pre_get_posts','sept_query_filter'); function sept_query_filter($query) { if ( !is_admin() && is_home() && $query->is_main_query() ) { $query->set('post_type', array( 'post', 'tribe_event' ) ); } }
Good news: the new code does not impact on current events with a 404 page.
Bad News: no changes at all.. still no events at the blog or post page..
??If you’ve already tried activating the events on the blog using the options in the plugin, and you’ve tried the code above, and it still doesn’t work, I’d recommend going over to The Events Calendar support forum and see if anyone there has any ideas. You can leave this post open and come back here with the information they provide if we need to do something else with the theme code.
- The topic ‘help with event calendar on hueman template’ is closed to new replies.