This topic has 10 replies, 3 voices, and was last updated 9 years by Abe.

  • Author
  • #86351
     akal
    Participant

    Hi,

    I would like to edit the file /wp-content/themes/kleo/kleo-framework/lib/class-multiple-sidebars.php

    (change L66-67 the ‘h5’ for a ‘span’)

    so I created a copy of this file in my child theme  /wp-content/themes/kleo-cild/kleo-framework/lib/class-multiple-sidebars.php

    but this copy is ignored, only the changes made on the original are considered…

    does that mean the kleo-framework files cannot be used in a child theme ?

    #86361
     sharmstr
    Moderator

    That’s correct. Based on your changes, I’m assuming you wanted to change the look of the title. You can override it using css in such a way that it wont effect all h5 tags on the site.

    COPY CODE
    
    .sidebar h5 {
        font-size: 17px;
        line-height: 27px;
        font-weight: 900;
        margin: 10px 0;
        display: block;
        border-top: solid 1px #fff;
        border-bottom: solid 1px #fff;
        text-align: center;
    }
    

    .

    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

    #86368
     akal
    Participant

    Hi @sharmstr

    No I would like to change the Hx structure for a span or div. This H5 is not a logical structure for my SEO strategy…

    So, no way to use kleo-framework files in my child theme ?

    Akal

    #86371
     sharmstr
    Moderator

    @abe – Is it possible to override the sidebar_generator class with a remove action, then and add_action for a custom init?

    COPY CODE
    
    add_action('init',array('sidebar_generator','init'));
    
    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

    #86487
     Abe
    Keymaster

    Hi, I have modified the file with the sidebar generator class so you can copy the whole class to your child theme if you like and it will load yours.
    You will need to edit this file and replace it’s content with the one in the attached file
    wp-content/themes/kleo/kleo-framework/lib/class-multiple-sidebars.php

    This change will be reflected in the next update so no need to worry when updating.

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

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    Attachments:
    You must be logged in to view attached files.
    #86489
     Abe
    Keymaster

    So in your child theme/functions.php you will have to copy the whole code from line 30 that looks like:
    ‘class sidebar_generator’ until line 475 when the class definition ends.

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

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #86567
     akal
    Participant

    Thank @sharmstr, thank @aben

    I replaced “class-multiple-sidebars.php” by the new one in /themes/kleo/kleo-framework/lib/
    it’s ok but when I copy from line 30 class sidebar_generator until line 475 to my child theme function, I’ve blank screen.
    So I excluded line 475 that is supposed to end the line 29 if (! class_exists('sidebar_generator')) { and took line 474, but that gives me front-end issues… same if I take from line 29 until line 475…

    Anyway, is there any other way to edit those 2 lines (70&71) 'before_title' => '<h5>', 'after_title' => '</h5>', by 'before_title' => '<span>', 'after_title' => '</span>', without burdening function.php with the whole class-multiple-sidebars.php content ?

    Akal

    #86568
     akal
    Participant

    @aben *@abe

    #86580
     Abe
    Keymaster

    Hi, I have modified the file to replace the content and now you can use in your child theme something like this:

    COPY CODE
    
    add_filter( 'sq_ms_before_title', 'my_before_title_widget');
    add_filter( 'sq_ms_after_title', 'my_after_title_widget');
    
    function my_before_title_widget() {
       return '<h5>';
    }
    
    function my_after_title_widget() {
       return '</h5>';
    }
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    Attachments:
    You must be logged in to view attached files.
    #86604
     akal
    Participant

    Works like a charm,
    thank a lot @abe & @sharmstr
    Akal

    #86607
     Abe
    Keymaster

    Glad to hear. That.

    Cheers

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

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

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

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

Log in with your credentials

Forgot your details?