Community Forums › Forums › Archived Forums › General Discussion › Add different Sidebars to each post of a CPT
Tagged: Custom Post Type, sidebar CPT, simple sidebars
- This topic has 9 replies, 3 voices, and was last updated 10 years, 7 months ago by Dan B.
-
AuthorPosts
-
August 2, 2013 at 11:33 pm #53878mistermarcMember
Hi there!
I am a Genesis Newbie and can't figure out the following:
My side is about Heart Rate Monitors and I created a CPT 'heartratemonitors'.
I also added the 'Genesis Simple Sidebar' plugin and managed to show it in the CPT Editor.
I would like a different sidebar for each Model/Custom Post (e.g. on a Heart Rate Monitor such as the 'Polar FT7' I like a sidebar showing 'FT7 Quick Stats', 'FT7 Amazon Ad's', 'FT7 Testimonials',etc.
However, my Sidebar selection (in this case 'sidebar-PolarFT7' in the CPT has absolutely no influence whatsoever. The primary sidebar always overrules.
I have already tried this tutorial http://www.carriedils.com/sidebar-custom-post-type/ which allowed me to add the 'sidebar-ft7' to one specific post in my CPT (in this case 'PolarFT7 review'.)
But now, as I said, I would like to add a new sidebar to a new post of my CPT and I just can't figure out how to do this.
Thank you very much for your help.
http://heartratemonitorreviews.netAugust 3, 2013 at 12:27 am #53883Brad DaltonParticipantPlease add this code at the end of your child themes functions.php file and change the cptname for each custom post type.
add_post_type_support( 'cptname', 'genesis-simple-sidebars' );
Source http://ahjira.com/enable-genesis-simple-sidebars-plugin-for-custom-post-types/
August 3, 2013 at 12:49 am #53886mistermarcMemberThank you very much for the quick reply.
I already had this code at the end of my child theme functions.php.
As I menitoned my choice of sidebars has absolutely no influence on the primary sidebar.
I created my CPT with the CustomPress plugin - could that have anything to do with it.
August 3, 2013 at 12:55 am #53887Brad DaltonParticipantThat's right however you can select a different second sidebar.
There will be a solution for this which may involve custom coding.
I'll see what in can find out.
What theme are you using and can you link to the CPT on your site please?
August 3, 2013 at 1:12 am #53888mistermarcMemberThank you very much!
The theme I am using is the 'Focus' Theme.
Not quite sure what you mean with the link to the CPT but here are my two best guesses - hope that's right:
In the Admin panel:
http://heartratemonitorreviews.net/wp-admin/edit.php?post_type=heartratemonitorsFrontend Example CPT:
http://heartratemonitorreviews.net/polar-ft7-review
Thanks again for looking into it.
August 3, 2013 at 2:22 am #53892Brad DaltonParticipantI tested this by adding the CPT portfolio from the Minimum child theme to the Focus theme and both the primary and secondary sidebar selection for Genesis Simple Sidebars plugin displays on all posts assigned to the custom post type(portfolio).
Must be the CPT plugin you used isn't fully compatible with Genesis plugins.
You could more easily create a portfolio style category archive using the code from the Balance theme which maybe a better solution if you want multiple archives.
Whats the main reasons you want to use a CPT?
I will write a tutorial about how to do this for you.
August 3, 2013 at 2:31 am #53893Brad DaltonParticipantIf you only want the CPT, here's the code you can modify simply by changing all instances of portfolio to polar-ft7-review and deactivating your plugin beforehand:
Then add this to your child themes functions.php file:
add_post_type_support( 'polar-ft7-review', 'genesis-simple-sidebars' );
You'll also need to copy the icons folder from within the Minimum themes images folder to the focus themes images folder.
August 3, 2013 at 3:28 am #53897mistermarcMemberThank you very much for that!
As I said, I am a novice when it comes to Genesis.
The main reason I used CPT is that I bought a plugin (Taxonomies-Filter Widget) which allows users to find a Heart Rate Monitor by filtering through multiple criteria. (You can see how it has been so far applied when you scroll down the primary sidebar on any page at http://heartratemonitorreviews.net
The Author of the plugin had a quick look at my site and suggested I create a CPT 'heartratemonitors' and use this for all my reviews. To this CPT I then add my various taxonimies such as Functions, Weight, Price, etc,).
He then suggested to create a 'Template file' for displaying all Heart Rate Monitors in a 'Grid System' which will then be used for filtering.
Once I got a few more reviews 'under my belt' I will need help to set this template up as well, since this exceeds my current level of expertise.
If I only want the CPT as you said, would that mean I have to register a CPT for every review I am doing (e.g. Polar FT7 Review, Polar FT4 Review, Garmin Forerunner 310XT Review, etc.)?
I really appreciate you help and time. If you feel that it might be too difficult to do this properly myself and it exceeds your generosity I am happy if you could quote me ( I hope I am ok mentioning that in this Forum) and check into the backend of my site.
Many thanks.
August 3, 2013 at 4:00 am #53905Brad DaltonParticipantMarch 17, 2014 at 2:02 am #95253Dan BMemberBrilliant! Thanks Brad.
I was searching the forums looking for a way to add the sidebar selector to my custom post types pages. The following code in my functions.php file did the trick (note that my custom post type name is 'projects').
add_post_type_support( 'projects', 'genesis-simple-sidebars' );
Dan @ ZindaMedia
Marketing, Fundraising and Social Media strategies for non-profits. -
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.