Hi there,
i found Sage and i immediately loved it but i have a (stupid?) question.
I made a template for display post of one category into a static page.
this is page-press.php
<?php
/**
* Template Name Press Template
*/
?>
<?php get_template_part('templates/page', 'header'); ?>
<?php while (have_posts()) : the_post(); ?>
<?php get_template_part('templates/content', 'iog_press') ?>
<?php endwhile; ?>
<?php the_posts_navigation(); ?>
and this is content-iog_press.php
<div id="nav-toolbar" class="btn-toolbar" role="toolbar" aria-label="letter-selector">
<div class="btn-group" role="group" aria-label="letter-selector">
<?php
//global $wpdb;
$years = $wpdb->get_results( "SELECT YEAR(p.post_date) AS year FROM wp_posts p
LEFT JOIN wp_term_relationships rel ON rel.object_id = p.ID
LEFT JOIN wp_term_taxonomy tax ON tax.term_taxonomy_id = rel.term_taxonomy_id
LEFT JOIN wp_terms t ON t.term_id = tax.term_id
WHERE p.post_type = 'post' AND p.post_status = 'publish' AND t.term_id=49 GROUP BY year DESC" );
foreach($years as $year) { ?>
<button type="button" class="btn btn-default <?php if ($year->year==date('Y')) echo ' active'?>" data-filter="<?php echo $year->year; ?>"><?php echo $year->year; ?></button>
<?php } ?>
</div>
</div>
<br>
<div id="content">
<?php
$args_press = array (
'cat' => 49,
'post_status' => 'publish'
);
$the_query_press = new WP_Query( $args_press);
if ( $the_query_press->have_posts() ) {
echo '<ul class="portfolio">';
while ( $the_query_press->have_posts() ) {
$the_query_press->the_post();
echo '<li class="col-lg-12">';
echo '<article class="col-lg-12 portfolio-desc thumbnail">';
echo '<div class="greyfot">';
echo '<div class="col-lg-5">';
if (has_post_thumbnail($post->ID)) {
$retina = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'thumbnail' );
echo '<a title="' . get_the_title() . '" href="' . get_permalink() . '"><img src="' . $retina[0] . '" alt="' . get_the_title() . '" style="display: block; width:100%; margin-bottom:5px; box-shadow:4px 5px 7px 0px rgba(0,0,0,0.29)"></a>' ;
} else {
echo '<a title="' . get_the_title() . '" href="' . get_permalink() . '"><img width="100%" src="/wp-content/themes/iog-theme/dist/images/logo.png" style="display: block;width:150px"></a>';
};
echo '</div>';
echo '<div class="col-lg-7">';
echo '<div class="text-center">';
echo '<a title="' . get_the_title() . '" href="' . get_permalink() . '"><h4>' . get_the_title() . '</h4></a>';
echo '<div class="press-excerpt">' . get_the_excerpt() . '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
echo '<footer>';
echo '<div class="press-meta">';
echo '<span class="published"><i class="fa fa-calendar-o"></i>'. get_the_date() .'</span>';
echo '<span class="comments-number"><a href="'. get_permalink().'">'. get_comments_number().'</a><i class="fa fa-comments-o"></i></span>';
echo '</div>';
echo '</footer>';
echo '</article>';
echo '</li>';
}
echo '</ul>';
?>
<?php
}
?>
</div>
My problem is that doesn’t appears navigation link “Newer Post” and “Older Post”
Ty all