1
Well, I created a personalized page where I need her to return all the posts you have registered on the site, as if it were the home.
I tried to do it the normal way, creating a custom page and assigning the same code to index.php
, however when I try to list all posts it just returns me the page as if it were a publication page...
<?php
/*
Template Name: Novos Posts
*/
get_header(); ?>
<div class="cont_marg">
<div class="pad_sd">
<?php if (have_posts()) : ?>
<ul class="lista-filmes">
<?php while ( have_posts() ) : the_post(); ?>
<?php $my_meta = get_post_meta($post->ID,'_my_meta',TRUE); ?>
<li id="post-<?php the_ID(); ?>" title="<?php the_title(); ?>">
<div class="titulo-box open-sans">
<h2 class="titulo-box-link">
<a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
</h2>
</div>
<div class="capa">
<div class="fluccs">
<div class="boxxer"><?php echo $my_meta['durat']; ?>min</div>
</div>
<a href="<?php the_permalink(); ?>" class="absolute-capa no-text effect"><?php the_title(); ?></a>
<?php the_post_thumbnail(array(158,226)); ?>
<div class="flutuador" style="background:none;">
<div class="audioy"><?php echo the_qualt($my_meta['qualt']); ?></div>
<div class="anolanc"><?php echo $my_meta['ano']; ?></div>
</div>
</div>
<div class="views"><?php echo getPostViews(get_the_ID()); ?> visitas</div>
</li><!-- #post-<?php the_ID(); ?> -->
<?php endwhile; ?>
<?php post_pagination();?>
</ul>
<?php endif; ?>
</div><!-- .pad_sd -->
</div><!-- .cont_marg -->
<?php get_footer(); ?>
You know when we create a custom page? Ready just that I do not want this page to be a post, I want her to return me all the posts I already have, but she just returned me what she weighs be her own. They understood??
Hello. Excellent placement. I would like to ask for a compliment: How would I do for loop displays, just posts from a particular category? I imagine it would be something like this:

 $the_query = new WP_Query ( array( 'post_type'=>'post', 'category' => 'any_category' ) ); 


That would be it?– Luciano Bezerra
@Lucianobezerra the path is this. You can see the category parameters here. Comprehensively, you could do
$the_query = new WP_Query ( array( 'post_type'=>'post', 'category_name' => 'minha_categoria' ) );
– Caio Felipe Pereira