Replies: 0
Hi,
Thanks for such a great plugin, it really is flexible. Currently i am showing 9 post per page and for the next post i want to put numeric pagination to the end. I tried next_posts_link() and its not showing next page but may be i am doing it the wrong way. Any help would be appreciated. my website is http://www.globemost.com Thanks
Bellow is my code:
<?php
/**
* Flexible Posts Widget: Old Default widget template
*
* @since 1.0.0
*
* This is the ORIGINAL default template used by the plugin.
* There is a new default template (default.php) that will be
* used by default if no template was specified in a widget.
*/
// Block direct requests
if ( !defined('ABSPATH') )
die('-1');
echo $before_widget;
if ( !empty($title) )
echo $before_title . $title . $after_title;
if( $flexible_posts->have_posts() ):
?>
<div class="front-page-posts blog-style-grid ">
<div class="header-side-bar">
<?php if ( is_active_sidebar( 'header-side-bar' ) ) : ?>
<?php dynamic_sidebar( 'header-side-bar' ); ?>
<?php endif; ?>
</div>
<?php while( $flexible_posts->have_posts() ) : $flexible_posts->the_post(); global $post; ?>
<article id="post-<?php the_ID(); ?>" <?php post_class('post-item'); ?>>
<div class="post-container">
<div class="post-meta-thumb">
<?php
if( $thumbnail == true ) {
// If the post has a feature image, show it
if( has_post_thumbnail() ) {
the_post_thumbnail( $thumbsize );
// Else if the post has a mime type that starts with "image/" then show the image directly.
} elseif( 'image/' == substr( $post->post_mime_type, 0, 6 ) ) {
echo wp_get_attachment_image( $post->ID, $thumbsize );
}
}
?>
<div class="sh-overlay-style1">
<div class="sh-table-full">
<a class="sh-overlay-item sh-table-cell" href="<?php the_permalink(); ?>">
<div class="sh-overlay-item-container">
<!--<i class="icon-link"></i>-->
<i class="fa fa-link" aria-hidden="true"></i>
</div>
</a>
<a class="sh-overlay-item sh-table-cell" href="">
<div class="sh-overlay-item-container second-child">
<i class="fa fa-search-plus" aria-hidden="true"></i>
</div>
</a>
</div>
</div>
</div>
<a href="<?php the_permalink(); ?>">
<h2 class="post-title"><?php the_title(); ?></h2>
</a>
<div class="gb-date-aut">
<span class="gb-aut">
by <a class="postaut" href="<?php the_author_link(); ?>"><?php the_author(); ?></a>
</span>
<p class="gb-date">
<?php the_date( get_option( 'date_format' ), '' ); ?>
</p>
</div>
<div class="post-content">
<p>
<?php
$excerpt= get_the_excerpt();
echo substr($excerpt, 0, 200);
?>...
</p>
</div>
<div class="post-meta post-meta-two">
<p class="gb-cat">
<?php the_category( ', '); ?>
</p>
</div>
</div>
</article>
<?php endwhile;?>
<div class="next-prev-wrap">
<span class="next"><?php next_posts_link( 'Older posts', $post->max_num_pages ); ?></span>
<span class="prev"><?php previous_posts_link( 'Newer posts', $post->max_num_pages ); ?></span>
</div>
</div><!-- .dpe-flexible-posts -->
<?php else: // We have no posts ?>
<div class="front-page-posts no-posts">
<p>
<?php _e( 'No post found', 'flexible-posts-widget' ); ?>
</p>
</div>
<?php
endif; // End have_posts()
echo $after_widget;