Query within meta box (5 posts)

  1. pshero
    Posted 3 years ago #

    Hey gang,
    I'm trying to execute a custom query within a meta box to call titles from a different custom post type. The query works just fine, but for some reason the all-in-one SEO plugin meta box that falls below this one isn't able to call it's meta values because, as it would appear, I've interrupted the loop and try as I may I can't figure out how.

    I have tried the ol' store the post in a variable and then recall it after my custom query loop is done, and that didn't work either.

    Here's what I'm working with:

    		// custom query for all posts in the team area
    		$team_query = new WP_Query();
    		$args = array( 'post_type' => 'team');
    		$team_query -> query( $args);
    		while ( $team_query->have_posts() ) : $team_query->the_post();
    			echo '<option value="';
    			echo the_title();
    			echo '">';
    			echo '</option>';

    Any help would be HUGELY appreciated.

  2. pshero
    Posted 3 years ago #


  3. libis
    Posted 2 years ago #

    i got same problem, anyone can help?

  4. esmi
    Forum Moderator
    Posted 2 years ago #

    @libis: If you require assistance then, as per the Forum Welcome, please post your own topic.

  5. libis
    Posted 2 years ago #

    @esmi ok, thx

Topic Closed

This topic has been closed to new replies.

About this Topic