Viewing 15 replies - 1 through 15 (of 18 total)
  • there’s a few ways, first thing that comes to mind is just a standard blog, with posts ordered to reflect the top 10. Just show 1 per page. If your theme doesn’t have the kind of numbered pagination you want you can use a plugin.

    Thread Starter TheAse3

    (@thease3)

    How do I “just show 1 per page”. So I add a new page not a post then…right?

    no, I mean on your blog page, show one post per page. You find that setting under settings, reading.

    Thread Starter TheAse3

    (@thease3)

    I just want to do the top 10 list for only one post. Should I still change the setting?

    oh, okay, no that’s different. You’re talking about paginated posts within a post? I wouldn’t know how to manage that. Your example shows products as posts, so they’re in a blog or category page, probably not in a single post.

    Thread Starter TheAse3

    (@thease3)

    Lol, I don’t want one post on a page. I want to do a top 10 list within one single post. Like this: https://styleengine.com/2012/06/26/hottest-sneakers-july/10/

    Thread Starter TheAse3

    (@thease3)

    Alright, thanks for your help! If anyone else has some suggestions that would be great!

    that’s one post per page, it’s paginated to show the others. By one post per page I mean, you only see one top 10 entry per page. You should just use your blog page, it would be easiest. A category page would actually be best. Do you know how to make one?

    Thread Starter TheAse3

    (@thease3)

    I don’t want to make a new category lol. I do I make it “paginated” on one single post?

    sorry, I don’t know how to get that layout in a post. What’s wrong with using a category, or even better, maybe a custom query?

    Thread Starter TheAse3

    (@thease3)

    How will adding a new category help me? And I don’t know how to do a custom query…lol

    If each top ten item is a post, they can be called to a category page. But the format will be a list of excerpts, rather than one post per page like you need.

    So we either mod your category page, or do a custom one with a custom query.

    you laugh a lot, I like that. So I’ll help you more asap. trust me, this I can do.

    Create a new page for your top 10 category.
    Put all 10 of your items as posts in a category.

    In the code below, replace “page-slug” with the slug name for your
    new category page, it will be the same as your page title, but all lowercase and with dashes between words.

    In the code below, change ‘cat’ ‘1’ to the category id number for your category.

    to do this:

    Go to Posts/Categories then select to edit your category for the top 10. on the category editing page you’ll find the id# in the url.

    <?php if (is_page('page-slug')) { ?>
    
    <?php query_posts( array(      'posts_per_page' => 1,      'cat' => '1',     'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1 ), ));
    
    if (have_posts()) {
       while (have_posts()) {
          the_post();
    
    the_content();?>
    
    <?php } ?>

    Now, you have to paste this code in your page.php template, put it right after where it says “if have posts”.

    then go check your page, you should see what you are after, of very close, you may need to edit some css so we’ll see

    correction, forgot the to close, rest the query, sorry!

    <?php if (is_page('page-slug')) { ?>
    
    <?php query_posts( array(      'posts_per_page' => 1,      'cat' => '1',     'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1 ), ));
    
    if (have_posts()) {
       while (have_posts()) {
          the_post();
    
    the_content();?>
    
    <?php endwhile();?>
    <?php endif();?>
    <?php wp_reset_query(); ?>
    
    <?php } ?>

    bare with me, it’s only been about 6 weeks away from wp but I’m already rusty ??

    like I said

    <?php if (is_page('page-slug')) { ?>
    
    <?php query_posts( array(
          'posts_per_page' => 1,
          'cat' => '1',
          'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1 ),));
    
     if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    
    <?php the_content();?>
    
    <?php endwhile; ?>
    
    <div class="alignleft"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '&larr;', 'Previous post link', 'cc' ) . '</span> %title' ); ?></div>
    <div class="alignright"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '&rarr;', 'Next post link', 'cc' ) . '</span>' ); ?></div>
    
    <?php
    endif;
    wp_reset_query(); ?>
    
    <?php } ?>

    I tested it but I couldn’t get it to show just one post so long as I specified a category..? If you still want to try it, give it a go, the issue could be with my theme or something. I’m working on it.

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘How do I add more than one thing to a page/post?’ is closed to new replies.