Show all posts

It can be very simple, but I searched and searched and could not find anything. What is the default blog page?

I’m trying to find a page that will display excerpts from all my blog posts, regardless of category or tags. I know that I can do www.xyz.com/category/widgets to get a list of all posts in this category. What I'm trying to do is just list all my blog posts without a filter.

Is there a default page in Wordpress to achieve this? Thanks.

+7
source share
4 answers

If you want it for all categories / tags / fron_page, there is a very quick solution - go to / wp -admin / options-reading.php and set the number of posts to -1 - this is usually impossible, since the input received min = 1, but You can easily change it, such as a browser.

If you need only one page with all the messages, you can simply create a template or short code with http://codex.wordpress.org/Template_Tags/get_posts and numberposts set to -1 and show what you need, for example

<?php $args = array( 'numberposts' => -1); $posts= get_posts( $args ); if ($posts) { foreach ( $posts as $post ) { setup_postdata($post); the_title(); the_excerpt(); } } ?> 
+8
source

For others, which may be Googling this ... If you replaced the main page of your site with a static page, but still want your message list to appear under a separate link, you need to:

  • Create a blank page (and specify whatever url / slug you like)
  • In Settings> Reading, select this new page as the Messages page.

Now, when you click on the link to this page in your menu, it should display all your recent messages (do not mess with the right code).

(Disclaimer: I posted the same answer to a similar question here .)

+8
source

It all depends on your topic, you will need blog.php, page-blog.php, archive.php (you get the idea).

This will be the php page that received the base WP_Query() without a category definition or anything else.

You could define this either in:

  • Settings> Read --- Blog Page
  • Topic options --- (something like) Blog categories [select all]
  • define it for all messages in the PHP file itself

I hope this helps, sorry, there is no answer "do it here": /

+5
source

thanks for this - I also found another way ...

In your theme files - find blog-page.php

If it is not there, copy blog.php as blog-page.php

In blog-page.php, a description of the change to be a blog (page). this will cause the template to be listed as Blog (Page), where you can use the template used by your Wordpress page.

Customize your sidebar using categories and widgets for recent posts ....

0
source

All Articles