• Resolved delemo

    (@delemo)


    Hello,

    First thank you for your great plugin.

    I have a question not directly related to your plugin, but maybe you could help me.

    The html markup of my slidebare looks as follow:
    <div id=”ocs_id_of_my_slidebar” class=”ocs_slidebar …”>
    <li id=”id_of_my_widget_1″ class=”widget …”>

    <li id=”id_of_my_widget_2″ class=”widget …”>

    <li id=”id_of_my_widget_3″ class=”widget …”>

    </div>
    So in the slidebar, my widgets are inside

    • tags which are imediatly inside a <div> tag. I think, that is not correct: there must be at least a
      tag.

      When uncommenting lines 428 through 431 in the off-canvas-sidebars.php, the markup is better.

      How could I override the mark up of the slidebar inside my theme so that changes are not lost after any update of your plugin?

      Best regards
      Simon

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @delemo,

    There is a filter hook available to change the markup :).
    Example:

    
    add_filter( 'ocs_register_sidebar_args', 'my_ocs_sidebar_args', 10, 3 );
    function my_ocs_sidebar_args( $args, $sidebar_id, $sidebar_data ) {
    	$args['before_widget'] = '<section id="%1$s" class="widget %2$s"><div class="widget-wrap"><div class="inner">';
    	$args['after_widget'] = '</div></div></section>';
    	$args['before_title'] = '<div class="widget-title-wrapper widgettitlewrapper"><h3 class="widget-title widgettitle">';
    	$args['after_title'] = '</h3></div>';
    	return $args;
    }
    

    The above code is just an example. You can set it to whatever you want!
    Please note that the ID key is always overwritten ($args['id']).

    Thanks, Jory

    • This reply was modified 8 years ago by Jory Hogeveen. Reason: code format
    • This reply was modified 8 years ago by Jory Hogeveen. Reason: Fix code
    Thread Starter delemo

    (@delemo)

    Hello Jory,
    It is working.
    Thank you for your (very) fast support.
    Best regards
    Simon

    Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @delemo,

    No problem!
    Let me know if you have more questions!

    Regards, Jory

    PS: if you like the plugin, please consider leaving a nice review, it will help the plugin grow ??

    Thread Starter delemo

    (@delemo)

    Done ??

    Best regards

    Plugin Author Jory Hogeveen

    (@keraweb)

    Awesome, thanks! ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Override off-canvas slidebar markup’ is closed to new replies.