appthemes_addon_query_filter( $wp_query )


Package


Description Description


Premium WordPress Apps

Top ↑

User Contributed Notes User Contributed Notes

  1. Skip to note 1 content
    Contributed by admin

    You can filter listings in WP_Query by adding parameter 'addon' with an addon type:

    		$args = array(
    			'post_type'           => 'ad_listing',
    			'ignore_sticky_posts' => true,
    			'addon'               => 'ad_listing-vip',
    		);
    
    		$vip_listings_query = new WP_Query( $args );
    
    

    Find the Addon Type in the addon’s admin page, in the Slug section.

  2. Skip to note 2 content
    Contributed by admin

    You can filter listings by the addon using following URL:

    http://example.com/ads/?addon=ad_listing-vip

    Where addon is the custom query parameter and ad_listing-vip is the addon type.
    But you have to register this custom parameter via following code:

    add_action( 'init', function() {
    	global $wp;
    	$wp->add_query_var( 'addon' );
    } );
    

    Add this code using your favorite way, or using Code Snippets plugin.

You must log in before being able to contribute a note or feedback.