Support » Plugin: Flex Posts - Widget and Gutenberg Block » List of feature requests and all post types

  • Resolved hima_art

    (@hirapapa)


    Thank you for listening to the requests and requests for sorting based on the update date that we proposed last time.

    As the title says, I would like to make another suggestion.
    * Since I cannot use English, I wrote it using Google Translate, so please forgive me if there is a part that is difficult to understand.

    By the way, my site is operated by adding multiple post types to divide articles into genres. Currently your plugin only allows you to select a single post type.

    I would be most grateful if you could make multiple selections, but I think that it will probably be quite a change (I am not a programmer so I do not know in detail …).

    So wouldn’t it be possible to simply add a post type choice of “any” to create a list of all post type posts in the archive and search results? ?

    Currently, when I add “any” under the definition of “post” and “page” as a test, it seems to work well. Probably not only me but also many people who need such extraction can be seen, so I hope you can implement it.

    We apologize for the unscrupulous requests as we did last time, but we would appreciate your consideration.

Viewing 4 replies - 1 through 4 (of 4 total)
  • +1

    Currently I’m doing a horrendous hack checking for a custom className inside flex_posts_get_query_args() and manually changing the $args[‘post_type’] value to the array of the post types I need.

    Plugin Author Tajam

    (@tajam)

    We have added “any” post type option in the latest version. Please update the plugin.

    I would love to be able to select several posts types but not all (any).

    Right now I need to maintain my hack to set $args[‘post_type’] as the array with post types I actually need in flex_posts_get_query_args() function.

    It works. But it’s ugly….

    Plugin Author Tajam

    (@tajam)

    @rodrigosevero you can use a filter to modify the query arguments, for example:

    function prefix_flex_posts_args( $args, $instance ) {
    	if ( 'custom' === $instance['className'] ) {
    		$args['post_type'] = array( 'book', 'movie' );
    	}
    	return $args;
    }
    add_filter( 'flex_posts_list_args', 'prefix_flex_posts_args', 10, 2 );

    Add this code in your child theme or your own plugin, so you don’t have to edit directly in flex posts plugin.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.