Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: post type –> buddypress support

@_natty_

Participant

so easy, so for that reason i didn’t find around LOL
many thanks.
Here for others user that needs to solve this kind of problem a piece of the code that helps me to solve the problem about showing post-type on sub-nav: This function referring to the first “animal” example goes in “function cats_screen content()”

if ( is_user_logged_in() )
{

	$autore=bp_displayed_user_id();

	$args = array(
		'post_type' => array('XXXX','YYYYYY'),
		'orderby' => 'menu_order',
		'post_status' => 'publish',
		'author' => $autore,
		'order' => 'ASC',
		'posts_per_page'=> '12'  // overrides posts per page in theme settings
		);

	$query=new WP_Query( $args );

	if ( $query->have_posts() )
	{

		while ( $query->have_posts() )
		{
			$query->the_post();
			$id = get_the_ID();
			echo '<div class="post_prod">';
			echo '<h3 class="title_prod"><a href="' . get_the_permalink() . '">' . get_the_title() .  '</a></h3>';
			if(has_post_thumbnail())
			{
				echo '<div class="pic_prod">';
				echo get_the_post_thumbnail($id,'thumbnail').'</div>'; 
			}else echo '<div class="img"><img height="150" width="150" src="xxxxxxx" ></div>';
			echo '<div class="exc_prod"><p>'.the_excerpt().'</p></div>';
			echo '</div>';

		}

	}else{echo wpautop( 'Sorry, no productions found' );}
	          	

}else{echo wpautop( 'Spiacente, non sei autorizzato' );}
wp_reset_query();
Skip to toolbar