badget

Biggest Sale! Special Offer!

Get 30% discount on all of our single themes with this coupon code: #30%SALE

Hurry up! *Limited time offer*

add new dynamic sidebar and sidebar template for individual pages to use widgets

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #16708

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

    Please guide me. Thank you.

    #16752

    Hi 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!

    #44594
    ilayxz
    Participant

    Hello,

    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

    #44604

    Hi 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!

    #44688
    ilayxz
    Participant

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

    #44696

    Hi 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 Here

    Also you can find some tutorial link here about Unhook themetic fuctions
    link 1 and link 2

    Also if you are unable to customize the code according to your need then you need to hire a developer. Sorry for this.

    Thank you!

    #44712
    ilayxz
    Participant

    Thank you very much

    #44728

    You are welcome anytime. 🙂

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.