Support ForumAdding a Sidebar on a specific theme template (CPT) – Support Forum https://support.ishyoboy.com/forums/topic/adding-a-sidebar-on-a-specific-theme-template-cpt/feed/ Sun, 05 May 2024 12:33:45 +0200 http://bbpress.org/?v=2.5.12-6148 en-US https://support.ishyoboy.com/forums/topic/adding-a-sidebar-on-a-specific-theme-template-cpt/#post-7028 <![CDATA[Adding a Sidebar on a specific theme template (CPT)]]> https://support.ishyoboy.com/forums/topic/adding-a-sidebar-on-a-specific-theme-template-cpt/#post-7028 Fri, 06 Mar 2015 19:48:37 +0000 JaraJara hi,
I have a custom taxonomy and Post Type. Already registered and all working fine.

I managed to duplicate the Boldial “archive.php” file into “taxonomy-myCPT.php” and it is being called perfectly by WP.

How can I add a custom sidebar created in the WP interface?

Even calling get_sidebar() directly it shows nothing…
I’m a programmer, so you can throw me code, I can handle…

Cheers.
;)

]]>
https://support.ishyoboy.com/forums/topic/adding-a-sidebar-on-a-specific-theme-template-cpt/#post-7029 <![CDATA[Reply To: Adding a Sidebar on a specific theme template (CPT)]]> https://support.ishyoboy.com/forums/topic/adding-a-sidebar-on-a-specific-theme-template-cpt/#post-7029 Fri, 06 Mar 2015 19:49:14 +0000 JaraJara sorry, just adding me to the email notification… ;)

]]>
https://support.ishyoboy.com/forums/topic/adding-a-sidebar-on-a-specific-theme-template-cpt/#post-7044 <![CDATA[Reply To: Adding a Sidebar on a specific theme template (CPT)]]> https://support.ishyoboy.com/forums/topic/adding-a-sidebar-on-a-specific-theme-template-cpt/#post-7044 Mon, 09 Mar 2015 06:08:46 +0000 IshYoBoy Hey JaraJara,

Glad we have skilled devs as well ;)

When you call get_sidebar() the code calls “sidebar.php”. If you have a look inside you can see that it makes some checks etc.. if you use get_sidebar(‘name’) WordPress will try to load the file “sidebar-name.php”.

You can duplicate the sidebar.php file, rename it to meet your name e.g.: “sidebar-custom.php” and remove the checks inside this file and call the sidebar manually. Hard code it :)

If you wish however to register the metaboxes so that the sidebar could be controlled via the backend then you need to some more coding. Please check this topic:

Custom Post Types – Use pagebuilder and Metaboxes as in pages

If you have further questions, feel free to shoot them.

Cheers

A 5 star rating is always a great motivation for us if you are happy with our theme or support!
Themeforest | MojoMarketplace | Creative Market

]]>
https://support.ishyoboy.com/forums/topic/adding-a-sidebar-on-a-specific-theme-template-cpt/#post-7088 <![CDATA[Reply To: Adding a Sidebar on a specific theme template (CPT)]]> https://support.ishyoboy.com/forums/topic/adding-a-sidebar-on-a-specific-theme-template-cpt/#post-7088 Mon, 09 Mar 2015 19:49:16 +0000 JaraJara Hello,

I did all you mentioned in your response.

I managed to show up a sidebar in the “archive.php” global page (I did a copy of that, naming following the WP theme hierarchy), but the sidebar is showing always at the bottom of the page. Even If I force/change “if ( ishyoboy_has_sidebar() )” to simply “true”, the layout doesn’t open up space for my sidebar…

am I missing something?

]]>
https://support.ishyoboy.com/forums/topic/adding-a-sidebar-on-a-specific-theme-template-cpt/#post-7089 <![CDATA[Reply To: Adding a Sidebar on a specific theme template (CPT)]]> https://support.ishyoboy.com/forums/topic/adding-a-sidebar-on-a-specific-theme-template-cpt/#post-7089 Mon, 09 Mar 2015 19:58:49 +0000 JaraJara Adding a note: My whole website has no sidebars. So the “Blog Sidebar” setting is off by default, I only need a Sidebar on specific pages (posts) which I managed to set successfully on the post level (setting), but since the “Archive” feature of WP is some sort of ethereal I do not know how to handle properly…

;)

]]>
https://support.ishyoboy.com/forums/topic/adding-a-sidebar-on-a-specific-theme-template-cpt/#post-7108 <![CDATA[Reply To: Adding a Sidebar on a specific theme template (CPT)]]> https://support.ishyoboy.com/forums/topic/adding-a-sidebar-on-a-specific-theme-template-cpt/#post-7108 Tue, 10 Mar 2015 08:42:49 +0000 IshYoBoy Hey,

Could you please share your URL so we can see what the generated output is? Also maybe create an admin account registered for hello@i
shyoboy.com so we can log in and check how the back-end looks like. Thanks

Cheers

A 5 star rating is always a great motivation for us if you are happy with our theme or support!
Themeforest | MojoMarketplace | Creative Market

]]>
https://support.ishyoboy.com/forums/topic/adding-a-sidebar-on-a-specific-theme-template-cpt/#post-7510 <![CDATA[Reply To: Adding a Sidebar on a specific theme template (CPT)]]> https://support.ishyoboy.com/forums/topic/adding-a-sidebar-on-a-specific-theme-template-cpt/#post-7510 Fri, 27 Mar 2015 16:50:02 +0000 JaraJara Hello, for the sake of documentation, here I post my findings to help others. I found n easy way to set a taxonomy/category template (which is not accessible through the backend UI) to set up a sidebar programatically:

In my case I’m using a copy of the taxonomy.php of the Boldial theme…


ishyoboy_show_breadcrumbs();

$ish_options[‘show_blog_sidebar’] = ‘1’; // adds a sidebar to the listing…
$ish_options[‘blog_sidebar_position’] = ‘right’;
$ish_options[‘blog_sidebar’] = ‘sidebar-1’;

….

Is there a way to rename the “sidebar-1” to a more meaningful name?

thanks guys!

;)

]]>
https://support.ishyoboy.com/forums/topic/adding-a-sidebar-on-a-specific-theme-template-cpt/#post-7526 <![CDATA[Reply To: Adding a Sidebar on a specific theme template (CPT)]]> https://support.ishyoboy.com/forums/topic/adding-a-sidebar-on-a-specific-theme-template-cpt/#post-7526 Mon, 30 Mar 2015 07:03:58 +0000 IshYoBoy Hey,

Thanks for sharing. It will surely help someone.

Has the sidebar-1 been created manually or using the sidebar generator which came with the theme. If manually then check your code as you can surely change the slug but you will have to move the widgets to another one before renaming and then put them back.

If created via the theme.. You will have to move the widgets, remove the sidebar and create a new one with meaningful name :)

Cheers

A 5 star rating is always a great motivation for us if you are happy with our theme or support!
Themeforest | MojoMarketplace | Creative Market

]]>