Hi.
Problem with showing posts on Home page and News page ( archive or archive-(…).php )
Mission:
Show 3 last post on Home (index page)
Show 6 posts on News (archive page)
Conclusion:
3 last posts on home page added (ok)
6 posts on News archive (failed) - it shows the same as the Home page (3 posts)
This is not my first site and this is the first time I encountered this problem…
Has anyone the same problem?
@Roxy Can you please send your project folder to the support so we can check your templates?
IMPORTANT: Please do not send a direct link to one of our email addresses from the sharing service but rather create a private SHARE LINK from Google Drive, Dropbox or WeTransfer which you will then copy into your reply to us.
If possible, please do not set an expiration date on your file share. We cannot guarantee that we will be able to view your files immediately after you send them.
Thx for reply. I already sent to support. I am in contact with Matjaz but I haven’t received a reply to the last email for some days (I’m in a bit of a hurry)…can I ask you please to try this process (it takes you five minutes )
1.making index.html (which will be index.php) - shows 3 x posts
2.making some.html (which will be archive.php) - shows 6 x posts
I have the same settings (the only difference is I didn’t wrote “post” in archive page under Show post smart - Post type … but as I know it is by default)
And the second…in wp dashboard I did the news page - selecting the news template - and in Reading I selected - Posts page: News
If I watched the url was ok /news but posts they were the same as on the home page (only 3 and not 6)
Ok…Thx Emmanuel…just one last question…
but if I want to display all posts (default posts) in some page with pagination (let’s say we call it News or Posts)…which .php name I have to use…
I think archive.php or I’m wrong…
(as in my example) The archive template is used when visitors request posts by category, author, or date. Note : this template will be overridden if more specific templates are present like category.php , author.php , and date.php .
For your need, you can build any page template and use a custom query so you can display exactly what you want. (What is important is how you call to the corresponding page)
This situation gave me the opportunity to introduce you to Query Monitor which is a perfect complement for any WordPress developer. Here we could use it to (easily) determine that the view was not using the right template. (examining the displayed code could also have given this information, but here it is presented in a visual way)
Switching your site to debug mode is also very useful to see all the possible problems in your templates.
Yes very useful…thanks
About a year ago i was making a website and used archive-news.php for default wordpress posts with template News with pagination and everything was ok…and it still works today…
The archive post type template is used when visitors request a custom post type archive. For example, archive-books.php would be used for displaying an archive of posts from the custom post type named books. The archive template file is used if the archive-{post-type} template is not present.