Add different Sidebars to each post of a CPT

Community Forums Forums General Discussion Add different Sidebars to each post of a CPT

This topic is: not resolved

This topic contains 9 replies, has 3 voices, and was last updated by  Dan B 5 months, 2 weeks ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #53878

    mistermarc
    Participant
    Post count: 5

    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.

    • This topic was modified 1 year ago by  mistermarc.
    • This topic was modified 1 year ago by  mistermarc.
    http://heartratemonitorreviews.net
    #53883

    braddalton
    Participant
    Post count: 9344

    Please add this code at the end of your child themes functions.php file and change the cptname for each custom post type.
    [php]
    add_post_type_support( ‘cptname’, ‘genesis-simple-sidebars’ );
    [/php]

    Source http://ahjira.com/enable-genesis-simple-sidebars-plugin-for-custom-post-types/


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #53886

    mistermarc
    Participant
    Post count: 5

    Thank 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.

    #53887

    braddalton
    Participant
    Post count: 9344

    That’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?


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #53888

    mistermarc
    Participant
    Post count: 5

    Thank 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=heartratemonitors

    Frontend Example CPT:

    http://heartratemonitorreviews.net/polar-ft7-review

    Thanks again for looking into it.

    #53892

    braddalton
    Participant
    Post count: 9344

    I 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).

    cpt

    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.


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #53893

    braddalton
    Participant
    Post count: 9344

    If 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:
    [php]
    add_post_type_support( ‘polar-ft7-review’, ‘genesis-simple-sidebars’ );
    [/php]

    You’ll also need to copy the icons folder from within the Minimum themes images folder to the focus themes images folder.


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #53897

    mistermarc
    Participant
    Post count: 5

    Thank 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.

    #53905

    braddalton
    Participant
    Post count: 9344

    Ok. Please send me an email brad@wpsites.net


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #95253

    Dan B
    Participant
    Post count: 26

    Brilliant! 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
    Freelance web development and design for non-profits and small businesses.

    • This reply was modified 5 months, 2 weeks ago by  Dan B.
    • This reply was modified 5 months, 2 weeks ago by  Dan B.
    • This reply was modified 5 months, 2 weeks ago by  Dan B.
    • This reply was modified 5 months, 2 weeks ago by  Dan B.
Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.