• Resolved John Stanley

    (@jjstan14)


    Hello,
    Previously I was with GeneratePress Pro + Elementor Pro and I could select which posts to appear on my home page. I want “Free Marketing Guides” which is a selection of certain post categories.

    However now I have removed Elementor/Pro in the quest for speed and have gone with all your plugins – GenerateBlocks Pro and WP Show Posts Pro. However I cannot see how I can choose the specific posts I want under either of these plugins (notably WP Show Posts or Pro version).

    I have attached a screenshot of the posts I would like to be able to select (compared to what is there currently). Currently your plugin only shows random posts which doesn’t suit the purpose at all. Please:
    1. Tell me how to do this using WP Show Posts or Pro version
    2. If can’t be don’t what is the lightest weight plugin to achieve this as I only need this on the home page.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Elvin

    (@ejcabquina)

    Hi there,

    You can select specific categories to display by adding attributes to your shortcode.

    Example: [wp_show_posts id="76440" settings="taxonomy=category&tax_term=category_1"]

    or try this for multiple categories. [wp_show_posts id="76440" settings="taxonomy=category&tax_term=category_1,category_2"]

    Make sure to change 76440 to your WPSP list.

    Alternatively, if the shortcode doesn’t work for you, we can change the query.

    Example: multiple categories + tag

    add_filter('wpsp_query_args',function( $args, $settings ){
    	if ( 76440 === (int) $settings['list_id'] ) {
    		$args['tax_query'] = array(
    			'relation' => 'OR',
    			array(
    				'taxonomy' => 'category',
    				'field'    => 'slug',
    				'terms'    => array( 'campaigns','project-updates' ),
    			),
    			array(
    				'taxonomy' => 'post_tag',
    				'field'    => 'slug',
    				'terms'    => array( 'sample-tag-1' ),
    			),
        	);
            var_dump($args);
        }
    	return $args;
    },10,2);

    Check here for more tax_query parameters. https://developer.wordpress.org/reference/classes/wp_query/#taxonomy-parameters

    Note: You can also do this without code within WPSP Pro UI but it’s against WordPress policy to support Premium/pro versions of the plugin here. You should post on our support forum for WPSP Pro questions here: https://wpshowposts.com/support/area/pro-support/

    Thread Starter John Stanley

    (@jjstan14)

    Thank you so much – resolved by using the WordPress Post ID in More Settings

    Plugin Support Elvin

    (@ejcabquina)

    Nice one. Glad you got it sorted.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘How to select specific posts for WP Show Posts’ is closed to new replies.