Ver Mensaje Individual
  #1 (permalink)  
Antiguo 20/06/2013, 01:09
nnggnzalez
 
Fecha de Ingreso: mayo-2013
Mensajes: 10
Antigüedad: 11 años
Puntos: 1
Exclamación Error al enlazar custom post types con query post

Buenas,
HE estado revisando mensajes y el codex y no encuentro mi error. A ver si alguien puede ayudarme

He creado un plugin para hacer un nuevo CUSTOM POST TYPE.

este es el código:
Código:
<?php
/*
Plugin Name: POPUP CUSTOM TYPE
*/

add_action('init', 'popup_custom_type');

function popup_custom_type(){
	register_post_type('popup_custom_type',
		array(
			'labels' => array(
				'name' => 'Popup Custom type',
				'menu_name' => 'Popup Posts'),
			'singular_label' => 'Popup Custom Type',
			'public' => true,
			'capability_type' => 'post',
			'has_archive' => true,
			'hierarchical' => false,
			'show_in_menu' => true,
			'supports' => array( 'title', 'editor', 'author', 'revisions', 'comments')
			)
		);
}
?>
He creado una plantilla, que se llama single-custom_post_type.php con esta llamada:

Código:
<?php
$query = array(
    'post_type' => 'popup_custom_type',
    'showposts' => 1,
    'post_status' => array('publish', 'pending', 'draft', 'auto-draft', 'future', 'private',     'inherit', 'trash')
);
query_posts($query);
if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php the_content(); ?>
<?php endwhile; else: endif; ?>
Y posteriormente he creado mi custom post type, cuando pre-visualizo en versión draft, me aparece perfectamente, con estilos y todo. Pero cuando publico, nada, me sale este error:
Sorry, no posts matched your criteria.

¿Alguien sabe qué puede estar pasando???

Graciass