Welcome to WebmasterServe!

FREE TO JOIN! Join us now to engage in informative and friendly discussions about Webmastering, SEO, SEM, Internet Marketing, Programming, Graphic Design, Online Jobs and more. What are you waiting for? Ready to join our friendly community? It takes just one minute to register.

Dismiss Notice

Join WebmasterServe Forums 
Join the discussion! Have a better idea or an opinion? It takes just one minute to register Click Here to Join

Tutorial Learn To Display Wordpress Posts On A Single Page

Discussion in 'Wordpress Content Management System' started by fisker, Feb 29, 2016.

  1. fisker

    Yellow Belt

    Joined:
    Jan 12, 2016
    Messages:
    82
    Ratings:
    +7 / -0
    Continuing my wordpress thing, I thought I will write up another one that is also good for your readers as well as SEO.

    With this article, I am going to walk you through exactly how you can do this without the need for pagination.

    Why would you want this?

    WordPress has a built-in archive for categories, tags, dates and authors. But most site owners prefer creating custom archives for their website. These archives usually highlight the popular posts on their website, display dates, list categories, tag clouds, etc. There are many such examples at the WPBeginner's archives page. But some blogs choose to display a list of their posts on one single page.

    There are a number of ways for you to display all posts on a single page. You can do so using short code, you can use a plugin for this and you can also create a custom template.

    I'm going to walk you through each of these methods ranked by ease of use:

    Display Posts Short code Plugin

    You'll have to install a display posts plugin. This plugin will get the job done right away. There are no setting for you to look at or configure. Just create a brand new page, label it archives or anything you want and simply paste this short code [display-posts posts_per_page="1000" order="DESC"] on the page. It will then start listing out all of your posts in chronological order. The setting will display as many as 1000 posts on a single page. You could change this number if you have more posts.

    Simple Yearly Archive Plugin

    If you are displaying all of your WordPress posts on one single page, it may just end up becoming very long to scroll through. Instead, you could opt to list posts by year. First, install and activate this plugin. Then you have to go to the settings page of this plugin. You will find that there are a number of ways in which this plugin lets you display posts. You can show them according to year or link them to different yearly archives. You can set it up as per your needs. Just don't forget to save any changes you've made. All you have to do after this is add the [SimpleYearlyArchive] short code to any page you want.

    Use a Template Code

    Even though using a plugin is probably be the easiest way of solving this problem, you may just be interested in learning how to do this using template codes. Why? Because using too many plugins actually slows down the site. Codes work faster and trust me, you want to do this. For this, you will first have to create a custom template and then copy the page.php styling file. After this, you should simply use the below loop for displaying all of your posts on one single page:

    01<?php
    02// the query
    03$wpb_all_query = new WP_Query(array('post_type'=>'post', 'post_status'=>'publish', 'posts_per_page'=>-1)); ?>
    04
    05<?php if ( $wpb_all_query->have_posts() ) : ?>
    06
    07<ul>
    08
    09<!-- the loop -->
    10<?php while ( $wpb_all_query->have_posts() ) : $wpb_all_query->the_post(); ?>
    11<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
    12<?php endwhile; ?>
    13<!-- end of the loop -->
    14
    15</ul>
    16
    17<?php wp_reset_postdata(); ?>
    18
    19<?php else : ?>
    20<p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
    21<?php endif; ?>

    If the above instructions aren't making any sense to you, I recommend you stick with option 1. I hope this article has helped you figure out how to display your WordPress posts on the same page.
     
  2. Swati Mishra

    Yellow Belt

    Joined:
    Dec 28, 2015
    Messages:
    644
    Ratings:
    +105 / -0
    There is another way i can suggest that can give you similar impression of having single page for each posts is to use one plugin. HTML for pages, is a plugin that can convert posts to be in HTML format (ending .html) and impression of pages.
     
  3. fisker

    Yellow Belt

    Joined:
    Jan 12, 2016
    Messages:
    82
    Ratings:
    +7 / -0
    impression of pages like how many impressions are shown at the end or start of the post? nice find.
     
  4. Prasoon Arora

    Yellow Belt

    Joined:
    Feb 1, 2016
    Messages:
    472
    Ratings:
    +24 / -0
    You can visit codex.wordpress.org if you need more help on wordpress. First create a custom wordpress template and then write the code.You can get the code online.You can easily pull in your WordPress listings and individual posts via XML and your choice of back-end/server-side scripting language. Wordpress has got plugins for every feature.
     
  5. bharath

    Staff Member Yellow Belt

    Joined:
    Dec 7, 2015
    Messages:
    772
    Ratings:
    +54 / -0
    I think these short codes are available on Codex.wordpress.com. I can believe their may be some plugin already exists.
    Can you tell me whether you implemented on your site or not? If yes what will be the result between pagination. How about the page load time, if we make 200 posts on a single page?
     
  6. Zirkon Kalti

    Yellow Belt

    Joined:
    Dec 10, 2015
    Messages:
    981
    Ratings:
    +120 / -0
    The Custom Content shortcode is great for displaying the entire archive of your blog in a single page. The shortcode plugin is free and can be downloaded from the Wordpress plugin directory.
     
  7. fisker

    Yellow Belt

    Joined:
    Jan 12, 2016
    Messages:
    82
    Ratings:
    +7 / -0
    I had implemented it on tech blog but I had auto scroll enabled in Sahifa theme, so there was no pagination. If there are say 300 posts, and you display 200 on a page, then you get 2 pages. Depends on how you should and tweak it.

    About load times, it depends whether you are displaying images or not. Cause if it is just links with anchor text, then load time is not at all affected which is what I would suggest. Cause loading so many images will definitely impact load times. But if you still want to do it, then in that case you need the images to load only when the user scrolls down. Use CDN too.
     
  8. bharath

    Staff Member Yellow Belt

    Joined:
    Dec 7, 2015
    Messages:
    772
    Ratings:
    +54 / -0
    I think it is good for inbound linking within the site, did you seen any ranking factors by keeping those links on one page.
    What is the loading time for your 200 links on a page without images? Thanks for your explanation.
     
  9. fisker

    Yellow Belt

    Joined:
    Jan 12, 2016
    Messages:
    82
    Ratings:
    +7 / -0
    Well the loading time I cannot check because unfortunately I had to shut the site down. I will explain what I did wrong with my blog though.

    USP - TAC is a tech blog that covers news, reviews, products and price comparison.

    You see, I was trying to cover so much, news stories, long detailed reviews, and a comparison engine that offered product comparison and price comparison. Moral - Start slow and stick with one sub-sub niche.

    To answer your question - to check loading time on of 200 links without image, just create a new wordpress post and create one title with a link. Then copy paste it 200 times. Should take 3-5 minuets.

    Benefit - This way you are able to check loading time on your own site instead of relying on someone other's site. Loading times can differ from site to site so its best to check on our site with a hands on approach. Let me know.
     

Share This Page