Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to query topics with specific meta


  • Ismail
    Participant

    @elhardoum

    Hi!

    I am trying to get a list of specific topics which have some meta data in common.

    No matter what I insert in 'meta_key' => 'name' property of query_posts function, the page still returns a list of the total topics.

    This is my code so far:

    add_action('wp', function() {
    
    	if( isset( $_GET['my_variable'] ) ) {
    
    		$page = get_query_var('paged') ? get_query_var('paged') : 1;
    		query_posts(array(
    
       			'paged' => $page,
    			'post_type'=> 'topic',
    			'order' => 'ASC'
    
    		));
    
    	}
    
    });

    If I visit site.ext/?my_variable=1 I get a list of all forum topics.

    How can I get this to work, using query_posts or WP_Query, or any other workaround? How can we target those specific topics and show them as a list?

    Regards,
    Samuel.

  • You must be logged in to reply to this topic.
Skip to toolbar