This topic has 3 replies, 2 voices, and was last updated 8 years by joy.

  • Author
  • #102815
     joy
    Participant

    Hello, I am trying to add a new widget area but when I add the following code, my footer widgets disappear. Help?

    COPY CODE
    function kleo_widgets_init() {
        register_sidebar( array(
            'name' => 'Island Top Section',
            'id' => 'island_top_new_widget_area',
            'before_widget' => '<aside>',
            'after_widget' => '</aside>',
            'before_title' => '<h3 class="widget-title">',
            'after_title' => '</h3>'
      ));
    }
    
    add_action ('widgets_init', 'kleo_widgets_init');

    Thank you.

    #102819
     sharmstr
    Moderator

    1 – Because you’re overriding the entire function that adds the Kleo specific widgets. If you’re going to override the function, you need to keep everything in there and just add yours.

    2 – Why not do it via Appearance > Sidebars. That’s what its for.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #102820
     sharmstr
    Moderator

    Also, you dont add the add_action either. Its already being called.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #102821
     joy
    Participant

    Oh goodness, I forgot all about the sidebar option. Thank you for reminding me.

Viewing 4 posts - 1 through 4 (of 4 total)

The forum ‘KLEO’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?