- This topic has 3 replies, 2 voices, and was last updated 2 years, 9 months ago by Elvin.
-
AuthorPosts
-
September 2, 2019 at 4:37 am #999011James
Hello:
I want to add a right hand side bar on all my post pages. This sidebar needs to contain links to other articles in the category.
In order to do this, I have changed the settings in customise/ layout/ sidebar menu and I have added a new category post element which confuses me a bit because under display rules/ location I have selected the post category from the drop down menu but then another drop down menu appears containing a list of all of my categories to choose from.
I don’t understand. Why do I need to select individual categories?
September 2, 2019 at 5:57 am #999053DavidStaffCustomer SupportHi there,
If you want to display Posts of the Same Category on each of your single posts you will need a plugin like this:
https://en-gb.wordpress.org/plugins/same-category-posts/
It provides you with a Same Category Post widget you can add to your sidebar. Then just set the Sidebar to be displayed on posts within the Customizer.
The Display Rules in Elements are solely for adding/changing that specific element, it won’t effect how a widget in a sidebar filters the recent posts for example.
July 13, 2021 at 1:49 pm #1854680ScottHow would I add this to the bottom of our blog posts so that it displays the 3 most current blogs of a certain category on the bottom of all posts within that category?
For Instance: post “Best PPC Practices” in category “PPC”
below the post content, display a 3 column (on desktop/1 column on mobile) showing the 3 most recent posts within the category PPC. I installed Same Category Posts plugin. Just not sure how to get it at the bottom of the post pages.
Thanks!!July 13, 2021 at 10:59 pm #1854947ElvinStaffCustomer SupportHi Scott,
David’s recommended plugin was for post listing on the sidebar.
If you need to display related posts in a column, you’ll need a post list plugin for that.
You can try WP Show Posts – https://wpshowposts.com/ – to create the post list in columns.
You then add this PHP snippet.
add_shortcode('dynamic_wpsp', function($atts){ $queriedArchive = get_queried_object(); $atts = shortcode_atts( array( 'id' => '' ), $atts, 'dynamic_wpsp' ); $settings = array( 'taxonomy' => $queriedArchive->taxonomy, 'tax_term' => $queriedArchive->slug, ); ob_start(); wpsp_display( $atts['id'], $settings ); return ob_get_clean(); });
And then hook in the shortcode [dynamic_wpsp id=”1234″] where
1234
is the WPSP list id.You can use a Hook Element to hook the shortcode in. Set the Hook Element’s hook to
generate_after_main_content
with display rule location set to “Post – all posts” so it only displays on the bottom single posts pages. 😀 -
AuthorPosts
- You must be logged in to reply to this topic.