Archived topic
Show posts on static frontpage + use static pages as Category Archives
30 replies · Started by Patryk on March 12, 2020
Hey,
do you know a easy way to show (selected) blog posts on static frontpage? I would like to show them in the same style as in the categories.
Thanks a lot.
Hi David,
thanks a lot.
Do you know how can i show the posts in the same style as in the categories?
It works fine when i turn my frontpage to dynamic but i would like to have a static frontpage with more content.
You can make a lot of the adjustments within the WP Show Posts list settings.
First you would want to change the Columns to 1.
Then adjust the image width to 300px and align it left.
You can also enable post meta and read more button.
Won't be an exact match, but will get you close enough and if need be we can help with a little CSS to finish it off.
Ok perfect David! Thanks!
Glad to be of help
Hi again,
now i use the WP Show Posts Plugin.
When replacing my categories with pages (that show my category posts), I used this script as instructed https://docs.wpshowposts.com/article/use-static-pages-as-category-archives/. However, my posts will redirect to the category page. Is this a bug? Is there a way to have it go to the proper post (and NOT to the category page)?
Here is the post example: https://www.patientenwerk.de/hausarzt/hausarzt-wechseln/
There is a redirect to: https://www.patientenwerk.de/hausarzt/
Can anyone help me please?
Thats odd - not seen this before.
Can you share the exact code you have added to the site ?
add_filter('request', function( array $query_vars ) {
if ( is_admin() ) {
return $query_vars;
}
if ( isset( $query_vars['category_name'] ) ) {
$pagename = $query_vars['category_name'];
$query_vars = array( 'pagename' => "$pagename" );
}
return $query_vars;
} );
Here is someone describing the same:
https://wordpress.org/support/topic/using-wpsp-to-replace-categories/#post-12540308
I have asked Tom to take a look.
Do you need to replace the Archives with Static pages ? Is it just a case of matching the WP Show Post and blog styles ?
Thanks David for your help.
I need to replace the categories with static pages. Its not only a case of matching the styles. In addition, the static pages should give me more options to set up the category content.
Thats understandable.
Depending on the scope of your needs, you may find the Header and Hook Elements may give what you need:
https://docs.generatepress.com/article/header-element-overview/
https://docs.generatepress.com/article/hooks-element-overview/
Ok, so there is actually no solution for the unwanted redirection?