- This topic has 7 replies, 4 voices, and was last updated 8 years, 7 months ago by Theme Horse Support Team.
-
AuthorPosts
-
September 27, 2014 at 7:18 am #16708entrepreneurassociationParticipant
Hello Themehorse,
I have unsuccessfully attempted to add a custom sidebar and display a custom sidebar area in the WP Admin Interface: Appearances –> Widgets. I would like to add custom sidebars in order to customize the layout and content of individual pages with custom templates that have widgetized content. For example, I have an executive board page and I wish to set that page to a custom created template that would display contents of a widget. I also have a resources page as well as many others that would hold different widgets. I would still like to keep the light green/teal colored bar with the text (named after the page) in these pages as well.
I have tried placing a modified copy of each of the interface_widgets.php, content-extensions.php and sidebar-extensions.php files and adding a new sidebar-executive.php file in a child-theme for interface. Is this the right way to go about it? The online tutorials to implement this seem very straightforward. I noticed that the core file, functions.php, doesn’t hold the add_action function to register sidebars. I feel that I may be missing something here. Can you provide an example for me to achieve the objective above?
I love the layout and other features of this theme and would hate to switch to a theme that may prove easier to add sidebars (but may lack the theme options and other features that I love with this one).
If necessary, I can provide the code that I used.
The childtheme directory looks like this:
content-extensions.php
interface_widgets.php
page-template-executive.php
sidebar-executive.php
sidebar-extensions.php
style.cssPlease guide me. Thank you.
September 29, 2014 at 6:17 am #16752Theme Horse Support TeamKeymasterHi entrepreneurassociation,
How to Create a widgets child theme ?==> In functions.php of the child theme, create your widgets and register them. Just copy the parent widget, change the name of widget like Theme Horse Child: Featured Page Widget, make customisation and create your custom widget. If you do this, the widgets of parent theme and child both will appear. Use your custom widget of child theme instead of the parent theme.
Just making same file structure in the child theme like /library/widgets won’t overwrite the parent file. Hope this helps.
You may register a dynamic sidebar inside this child theme functions.php, We can’t help you all coding so you need to hire a developer to fix it or customise the code.
Thank you!
May 1, 2016 at 5:11 pm #44594ilayxzParticipantHello,
I have a similar problem;
First all, thank you for hint above. I’ve already created a widget area. To this I have used the functions.php for my child theme:
register_sidebar( array( 'name' => __( 'Unsere Lesitungen Sidebar', 'interface' ), 'id' => 'unsere_leistungen_sidebar', 'description' => __( 'Shows widgets at Right side for Unsere Leistungen.', 'interface' ), 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => '</aside>', 'before_title' => '<h2 class="widget-title">', 'after_title' => '</h2>' ) );
This works. I see my new area in Dashboard/Design/Widgets on the right side. It name’s “Unsere Lesitungen Sidebar”.
My problem is the following:
To register a dynamic sidebar for may widget in this child theme functions.php, I have the following code:if ( is_active_sidebar( 'unsere_leistungen_sidebar' ) ) : dynamic_sidebar( 'unsere_leistungen_sidebar' ); endif;
But it doesn’t work. I’d like to have in my right-sidebar. If I add this code-snippel in the sidebar-extentions-php for Theme interface inside the function interface_display_right_sidebar(), it works. But it must work for my child-theme.
Can you help me please? Where do I make mistake?
Thank you in advance
May 2, 2016 at 10:35 am #44604Theme Horse Support TeamKeymasterHi ilayxz,
If it works fine with parent theme then there is something issues with your child theme. It needs code customization. You need to hire a developer as this is a new feature to add in the theme.
Thank you!
May 4, 2016 at 2:41 pm #44688ilayxzParticipantThank you for your answer.
My child-theme work normally impeccable. Every time I have problem, if a subfolder come into question (like the sidebar-extensions.php, it is located at interface-child\inc\structure – Folder).
I’d quite like to learn code customization self. Could you please recommend me a link for learn it?
Thank you very much!
May 5, 2016 at 9:58 am #44696Theme Horse Support TeamKeymasterHi ilayxz,
Create the same structure in the Child theme will not overwrite the parent theme. View below example link that we have already defined how to edit page 404.php
Link HereAlso you can find some tutorial link here about Unhook themetic fuctions
link 1 and link 2Also if you are unable to customize the code according to your need then you need to hire a developer. Sorry for this.
Thank you!
May 5, 2016 at 7:43 pm #44712ilayxzParticipantThank you very much
May 7, 2016 at 9:13 am #44728Theme Horse Support TeamKeymasterYou are welcome anytime. 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.