I'm trying to create a page that pulls news from a specific category. The question is Threme
, should I put this code with the name page_nome_da_page.php
to pull config
? Or should I put it somewhere else?
Follow the code:
<?php
/**
* Template Name: Saúde Caixa
*
* @package APCEF
*/
get_header(); ?>
<div class="container">
<div class="row">
<!-- Main Content -->
<div class="col-md-9 border-right">
<div class="main-content" id="main">
<div class="row">
<div class="col-md-12">
<div class="text-content center">
<?php the_content(); ?>
</div>
</div>
</div>
<ul class="result-list">
<?php
$paged = get_query_var('paged');
query_posts('category_name=saude-caixa&paged='.$paged);
?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<article class="blog-item-list">
<li class="result-item">
<div class="text-content">
<?php if(has_post_thumbnail($post->ID)): ?>
<div class="entry-image">
<img src="<?php the_post_thumbnail_url($post->ID, 'ag-apcef-large'); ?>" alt="<?php the_title(); ?>">
</div>
<?php endif; ?>
<a href="<?php the_permalink() ?>"><h2><?php the_title(); ?></h2></a>
<div class="entry-meta">
<span class="entry-date"><i class="fa fa-clock-o"></i> <time><?= get_the_date(); ?></time></span>
</div>
<?php the_excerpt() ?>
<a href="<?php the_permalink(); ?>" class="link">Ler Tudo</a>
</div>
</li>
</article>
<?php endwhile; endif;?>
</ul>
<?php
the_posts_pagination( array(
'mid_size' => 2,
'prev_text' => false,
'next_text' => false,
'screen_reader_text' => ' '
) );
?>
</div>
</div>
<!-- Sidebar -->
<div class="col-md-3" id="sidebar">
<?php get_sidebar(); ?>
</div>
</div>
<?php get_footer(); ?> '