I'm using WP Types Plugin and all works fine, now I need to show the contents created through that plugin and this is how I'm doing:
$args = array(
'posts_per_page' => 15,
'category_name' => 'legislacion',
'orderby' => 'post_date',
'order' => 'DESC',
'post_type' => 'post',
'post_status' => 'publish',
'suppress_filters' => true
);
$legislacion_posts = get_posts( $args );
?>
<ul>
<?php foreach ( $legislacion_posts as $post ) : setup_postdata( $post ); ?> ?>
<li>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
</li>
<?php endforeach;
wp_reset_postdata(); ?>
</ul>
But I'm not getting the posts from that category, why?
EDIT
This is the content of archive-legislaciones.php
file:
<?php
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Pages Template
*
*
* @file archive-legislaciones.php
* @package Responsive
* @author Emil Uzelac
* @copyright 2003 - 2013 ThemeID
* @license license.txt
* @version Release: 1.0
* @filesource wp-content/themes/responsive/page.php
* @link http://codex.wordpress.org/Theme_Development#Pages_.28page.php.29
* @since available since Release 1.0
*/
?>
<?php get_header(); ?>
<?php if ( is_page( 'legislaciones' ) ) { ?>
<div id="content" class="grid col-620">
<?php
$args = array(
'posts_per_page' => 15,
'category_name' => 'legislacion',
'orderby' => 'post_date',
'order' => 'DESC',
'post_type' => 'post',
'post_status' => 'publish',
'suppress_filters' => true
);
$legislacion_posts = get_posts( $args );
?>
<ul>
<?php foreach ( $legislacion_posts as $post ) : setup_postdata( $post ); ?>
<li>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
</li>
<?php endforeach;
wp_reset_postdata(); ?>
</ul>
</div>
<?php get_sidebar(); ?>
<?php } ?>
<?php get_footer(); ?>
Something is wrong there?