[Resolved] Please add support to customise register_sidebar element type

Home Forums Support [Resolved] Please add support to customise register_sidebar element type

Home Forums Support Please add support to customise register_sidebar element type

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1007446
    Mark

    Hi,

    I love the theme, I am using it on all my sites going forward where I can. its light but also customisable and gives me a break from underscores.

    for SEO purposes it would be fantastic to add an option to customise the widget element type from h2 to either h3/h4/p/span etc?

    I have hardcoded it for current use but will forget when I update in the future.. ๐Ÿ™‚

    /inc/general.php

    		foreach ( $widgets as $id => $name ) {
    			register_sidebar( array(
    				'name'          => $name,
    				'id'            => $id,
    				'before_widget' => '<aside id="%1$s" class="widget inner-padding %2$s">',
    				'after_widget'  => '</aside>',
    				'before_title'  => apply_filters( 'generate_start_widget_title', '<h2 class="widget-title">' ),
    				'after_title'   => apply_filters( 'generate_end_widget_title', '</h2>' ),
    			) );
    		}
    #1007453
    David
    Staff
    Customer Support

    Hi there,

    if you’re looking to change the tag on the widget title then you can use the filter.
    This topic provides an example where the user wanted to inject a span tag within the H2:

    https://generatepress.com/forums/topic/widget-title-span/#post-976895

    Let me know if understood correctly.

    #1007461
    Mark

    Perfect, of course I should have known! thanks alot.

    #1007466
    David
    Staff
    Customer Support

    Almost everything in GP has a filter – its Tom’s obsession ๐Ÿ™‚
    Glad to be of help.

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