• Resolved jdgmedia

    (@jdgmedia)


    How am I able to show both events and locations on the homepage of my site in latest posts?

    I’ve added this to my functions.php…

    add_filter( 'pre_get_posts', 'my_get_posts' );
    function my_get_posts( $query ) {
    	if ( is_home() && false == $query->query_vars['suppress_filters'] )
    		$query->set( 'post_type', array( 'post', 'location' ) );
    	return $query;
    }

    It shows location posts (if I change to event, it shows event posts). What code would I need to put in place so that both appear?

    https://www.ads-software.com/plugins/events-manager/

Viewing 1 replies (of 1 total)
  • Plugin Support angelo_nwl

    (@angelo_nwl)

    hi,

    you can try to add ‘event’,’location’ in the post type array however sometimes it depends on your theme (maybe you can try to ask your theme provider)

Viewing 1 replies (of 1 total)
  • The topic ‘Show events and locations with normal posts’ is closed to new replies.