- This topic has 5 replies, 2 voices, and was last updated 5 years ago by
Elvin.
-
AuthorPosts
-
March 7, 2021 at 1:11 pm #1685898
Janine
Hi.
What would like to create a custom archive page that lists all of my posts by category. And not the category names.
What is the easiest way to accomplish that in Gutenberg?
Thank you.
March 7, 2021 at 11:05 pm #1686179Elvin
StaffCustomer SupportHi there,
I’m not exactly sure I understand how you want the posts sorted but you should be able to create an archive page with Gutenberg using WP Show Posts plugin for this. http://wpshowposts.com/
Do you have any reference sites you’d like to duplicate so we could better understand how you want the post list to be ordered/sorted? Let us know.
March 8, 2021 at 12:59 pm #1687257Janine
Hi.
I want to be able to manually sort my posts by subject matter on a custom archive page.
Thank you.
March 8, 2021 at 6:15 pm #1687449Elvin
StaffCustomer SupportYou can create a custom archive page with this arrangement:
Edit the page and add a WPSP list for each category you have.
You then make sure these WPSP list you’ve added has its proper category applied to it.
Alternatively, you can make an automated WPSP list for each categories by using this PHP snippet to allow for use of
[cat_listing id=""].add_shortcode('cat_listing',function($atts){ ob_start(); $atts = shortcode_atts( array( 'id' => '' ), $atts, 'cat_listing' ); $categories = get_categories( array( 'orderby' => 'name', 'order' => 'ASC' ) ); foreach( $categories as $category ) { $category_link = sprintf( '<h2><a href="%1$s" alt="%2$s">%3$s</a></h2>', esc_url( get_category_link( $category->term_id ) ), esc_attr( sprintf( __( 'View all posts in %s', 'textdomain' ), $category->name ) ), esc_html( $category->name ) ); echo $category_link; $settings = array( 'tax_term' => $category->name, ); wpsp_display( $atts['id'], $settings ); } return ob_get_clean(); });After applying this you should be able to use
[cat_listing id=""]where id=”” is the ID of the WPSP id you want to use.Example:
[cat_listing id="4739"]See it in action on this demo page: [cat_listing] demo page
March 9, 2021 at 5:06 am #1687940Janine
Thank you, Elvin.
March 9, 2021 at 4:42 pm #1688874Elvin
StaffCustomer SupportNo problem. 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.