WordPress.org

Forums

Simple Page Sidebars
[resolved] Display Sidebar on a Custom Post (12 posts)

  1. paolosan
    Member
    Posted 2 years ago #

    Hello, thanks for your plugin, i have a question,

    I use this theme http://white-rock.progressionstudios.com/ and i would like to use your plugin, but my theme use custom post, http://smartsocialmedia.fr/demo/restaurant/?menu_type=pizzas

    my question is how i can choose my sidebar on a custompost

    thank you

    http://wordpress.org/extend/plugins/simple-page-sidebars/

  2. Brady Vercher
    Member
    Plugin Author

    Posted 2 years ago #

    Hi paolosan. This plugin was mainly built for use with pages, so it's not particularly suited for using with custom post types. Although, if you're comfortable editing code, you can add a short snippet to your theme's functions.php file to add support to other post types.

    Otherwise, there are a few other plugins that you might look into for more advanced functionality.

  3. rtwheelock
    Member
    Posted 2 years ago #

    Brady,

    What is the short snippet that I would have to add to accomplish showing the custom sidebar options on pages with the different post-type than "page" I have been looking through the plugin and have not been able to find how to do it.

    Your help is greatly appreciated.

  4. rtwheelock
    Member
    Posted 2 years ago #

    forgot to subscribe to the topic

  5. Brady Vercher
    Member
    Plugin Author

    Posted 2 years ago #

    Just add this snippet and replace {{post_type}} with your custom post type:

    function customprefix_init() {
    	add_post_type_support( '{{post_type}}', 'simple-page-sidebars' );
    }
    add_action( 'init', 'customprefix_init' );
  6. rtwheelock
    Member
    Posted 2 years ago #

    That did it, thank you so much and thanks for the super speedy reply. That was awesome.

    Thanks for a great plugin!!

  7. Brady Vercher
    Member
    Plugin Author

    Posted 2 years ago #

    No problem. Glad it worked for you and thanks for the feedback!

  8. prinivi
    Member
    Posted 1 year ago #

    Sorry Brady. Rookie here.

    When you change {{post_type}} for a custom post type that you need is something like

    add_post_type_support( 'Post', 'simple-page-sidebars' )

    ... if you want to add the sidebar for ALL posts created ?

    Thanks in advance and good job !!

    Roger

  9. prinivi
    Member
    Posted 1 year ago #

    forgot to subscribe to the topic

  10. Brady Vercher
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Roger,

    The post type name is lowercase, so you'd just use post in that snippet. It doesn't add a sidebar to any post, it just enables the ability to replace sidebars on a per-post basis if they're using the default sidebar to begin with.

    Defining a sidebar to use for all posts would require some additional code, or should probably be done in the theme (or with a different plugin).

    Hope that helps.

    Cheers,
    Brady

  11. prinivi
    Member
    Posted 1 year ago #

    Thanks Brady. Clear :)

    Roger

  12. Pentame
    Member
    Posted 1 year ago #

    Just provide a wp_reset_query(); at the end of your loop. It works fine.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Simple Page Sidebars
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.