• Resolved betyonfire

    (@betyonfire)


    I’m using Events Manager for Events on my site and would like to be able to use this plugin to feature the events. I set up the fpw_post_types filter for events and they now display in the widget and I can choose the event I want to feature. However, nothing shows up on the front end. The events I’m choosing do have excerpts and images.

    The site is online here: https://www.castinehistoricalsociety.org/
    I’m using the plugin in two places on the homepage already and it’s working fine — but just not with events.

    My filter looks like this:

    add_filter( 'fpw_post_types', 'fpw_add_post_type_to_feature' );
    function fpw_add_post_type_to_feature( $post_types ) {
        $post_types[] = 'event';
        return $post_types;
    }

    What could I be missing?

    Thank you for any help!

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

    (@mrwweb)

    @betyonfire Thanks for writing a clear bug report!

    I was able to confirm the problem. The Events Manager plugin is doing something to interfere with the widget’s query, as I have tested this with other plugins and custom post types that work.

    That said, I was able to figure out a fix that is probably an improvement to the plugin anyway. I’ll release in the next week or so, but I’d like to test it on a few other plugins and make a few other changes first.

    In the mean time, if you want an immediate fix, here’s what you can do (if you feel comfortable editing plugin files which I’m guessing you are):

    1. Go to Line 323 of /wp-content/plugins/feature-a-page-widget/inc/fpw_widget.class.php.
    2. Change 'post_type' => any, to 'post_type' => fpw_post_types(),

    The result of the change should look like this (Lines 321-327):

    
    $widget_loop = new WP_Query(
    	array(
    		'post_type' => fpw_post_types(),
    		'post__in' => array( intval( $instance['featured_page_id'] ) ),
    		'ignore_sticky_posts' => true
    	)
    );
    
    • This reply was modified 7 years, 5 months ago by mrwweb.
    • This reply was modified 7 years, 5 months ago by mrwweb.
    Thread Starter betyonfire

    (@betyonfire)

    Hi Mark,

    Thanks for your speedy answer and quick fix. That worked just fine.

    Michelle

    Plugin Author mrwweb

    (@mrwweb)

    Just closing the loop. v2.1.1 is out with this fix and a few other minor improvements.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom Post Types appear in widget, but not on page’ is closed to new replies.