[wp-testers] is_post_type not working correctly

hedwig at senzafineonline.net hedwig at senzafineonline.net
Fri Jun 4 16:42:59 UTC 2010


I tried the solution but it only got things worse.

The code I used was for the current film's menu, where it would  
display all related content, grouping them by post type

This is the code I used, and worked before RC1 and RC2

	// Get all the movie related pages
	$movie_pages = query_posts(array(
		'orderby' => 'title',
		'posts_per_page' => -1,
		'post_status' => 'publish',
		'movie' => $movie title
	));

	if ( have_posts() ) : while ( have_posts() ) : the_post();

		if ( is_singular('video') )
			$videos .= '
				<li><a href="'. get_permalink() .'" title="'. get_the_title 
() .'">'. remove_movie_title( get_the_title() ) .'</a></li>';

		if ( is_singular('gallery') )
			$gallery .= '
				<li><a href="'. get_permalink() .'" title="'. get_the_title 
() .'">'. remove_movie_title( get_the_title() ) .'</a></li>';

		if ( is_singular('soundtrack') )
			$soundtrack .= '
				<li><a href="'. get_permalink() .'" title="'. get_the_title 
() .'">'. get_the_title() .'</a></li>';

	endwhile; endif;

So each variable $videos, $gallery and $soundtrack would later be  
include in separate lists in the film's menu.

Changing the function for is_singular() doesn't display anything.

You can check the sidebar menu functionality at http:// 
moviefy.senzafineonline.net/movies/prince-of-persia-the-sands-of-time


More information about the wp-testers mailing list