Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Ajay

    (@ajay)

    Hi,

    You can’t do that with the shortcodes. You can however do this manually if you’re editting your theme files.

    Thread Starter cicino

    (@cicino)

    Ok, how can I edit it? Please advice

    Plugin Author Ajay

    (@ajay)

    Hi,

    This code will allow you to offset the first post. Please note that I haven’t tested it yet.

    <?php
    $top_posts = tptn_pop_posts( 'posts_only=1&limit=20' );
    $top_posts_array = wp_list_pluck( $top_posts, 'postnumber' );
    $top_posts_array = array_slice ( $top_posts_array, 1 );
    	$args = array(
    		'post__in' => $top_posts_array,
            );
    $the_query = new WP_Query( $args ); ?>
    
    <?php if ( $the_query->have_posts() ) : ?>
    
    	<!-- pagination here -->
    
    	<!-- the loop -->
    	<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
    		<h2><?php the_title(); ?></h2>
    	<?php endwhile; ?>
    	<!-- end of the loop -->
    
    	<!-- pagination here -->
    
    	<?php wp_reset_postdata(); ?>
    
    <?php else : ?>
    	<p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
    <?php endif; ?>
    Thread Starter cicino

    (@cicino)

    Unfortunately.. it doesn’t work ??

    Only lists the tittles of 10 posts.

    Any other idea please?

    Plugin Author Ajay

    (@ajay)

    Hi,

    That’s because of the custom code there which only returns the titles. What would you like to display exactly? The output can be easily customised.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Can I split results from shortcode [tptn_list limit="5" ] ???’ is closed to new replies.