Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Barry

    (@barryhughes-1)

    This should actually be pretty easy. What I’m outlining here would certainly give you some “rough” results initially, but with a little care and attention you could massage the appearance and so on.

    Basically, set up events on the front page of your blog as you have already done.

    Next, add the following snippet to your theme’s functions.php file:

    add_filter( 'tribe_events_after_html', 'blog_posts_on_front_page', 100 );
    
    function blog_posts_on_front_page() {
    	// We only want to do this on the homepage
    	global $wp_query;
    	if ( ! $wp_query->get( 'eventrocket_frontpage' ) ) return;
    
    	// Setup a custom blog query
    	$blog_query = new WP_Query( array( 'post_type' => 'post' ) );
    
    	// Loop through the results
    	while ( $blog_query->have_posts() ) {
    		$blog_query->the_post();
    
    		// For better results, you might simply pull in an existing
    		// theme template here
    		the_title();
    		the_content();
    	}
    }

    You should now get a stream of blog posts beneath the calendar output. As the comments suggest you could also potentially pull in an existing theme template to display the blog posts and make things a little prettier … what the template would be and whether it would work successfully with this approach would vary theme-to-theme.

    What do I have to change to load the Blog-Posts before the calendar (and before the filter bar)?

    Plugin Author Barry

    (@barryhughes-1)

    Note the after keyword in the first line of the snippet above … try changing that to before and use a lower priority (such as 10 rather than 100).

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to have Filter, Calendar & Posts on homepage?’ is closed to new replies.