- This topic has 7 replies, 2 voices, and was last updated 5 years, 3 months ago by Tom.
-
AuthorPosts
-
October 6, 2019 at 1:08 pm #1027833Yves
Hi
I have created the blog page under
/aktuell
. Everything works wonderfully. Now I want to create another page like the blog overview under/overview
or anywehre.It is important to me to have the same html structure, so that my css takes effect. That’s why I do not want to use
new WP_Query ($ args)
or a Plugin like DisplayPosts.I would like to make the same call as it happens automatically under /aktuell
I found the
generate_blog.php
– but how do I make a call eg. via hookOctober 6, 2019 at 9:14 pm #1027996TomLead DeveloperLead DeveloperHi there,
How would you be querying posts on the overview page? Where would they be coming from? Maybe a custom post type?
Let me know π
October 7, 2019 at 8:05 am #1028496YvesI tried with a custom post type. The question is how do I call the content in it?
October 7, 2019 at 6:40 pm #1028894TomLead DeveloperLead DeveloperYour custom post type should come with a standard archive page, just like the GP blog template.
This might help: https://www.wpbeginner.com/wp-tutorials/how-to-create-a-custom-post-types-archive-page-in-wordpress/
Let me know π
October 8, 2019 at 11:57 am #1029600Yvesbut the custom archive page shows only the posts from the custom post type – it’s clear. I would like to see all posts from the blog.
Maybe I should just rebuild the view with WP Show Posts. Then I could also implement the related post with this
Or I can find out how I call the blog posts in a new template, with exactly the same HTML as on the blog page.There must be called a certain function, so that instead of the static page the blog post on the main page are displayed.
Tom, thank you very much, especially because I noticed that it does not have anything to do with Generatepress π
October 8, 2019 at 7:51 pm #1029830TomLead DeveloperLead DeveloperHmm, I’m confused – so your two blog pages would display the same blog posts? What would be the difference between the two?
October 9, 2019 at 8:31 am #1030415YvesSorry, i was too inaccurate. I do not know enough about WordPress.
the goal is:
I have the blog post index page under/aktuell
, with athe newest posts. And I want another overview with all posts on the start page/
, but where I want to prepare the content a bit more. I thought about sorting all posts by categories and organizing the categories into a tab view.On both pages I wanted to display the individual posts as cards. To write the css rules only one time, its would bean an advantage to use the same template and the same html structure. So my first thought is to take the generated Content from the blog posts index page and filter it to build the new view with the category tabs.
October 9, 2019 at 7:21 pm #1030835TomLead DeveloperLead DeveloperWP Show Posts might be the way to go in that case.
Otherwise, you need to create a page template and set up a
WP_Query
:
https://www.wpbeginner.com/glossary/wp_query/
https://generatewp.com/wp_query/ -
AuthorPosts
- You must be logged in to reply to this topic.