[Support request] Filter plugin doesnt work

Home Forums Support Filter plugin doesnt work

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1425448
    Nina

    I want to change the widget title from h2 to h4. I’ve seen the filter code I need to use, and read I should do this either by using a code snippet or by making a plugin. I then made a plugin, inserted the code, and nothing happens? Do I need to link my plugin to the theme somehow?

    #1425493
    Leo
    Staff
    Customer Support

    Hi there,

    Using the code snippets plugin should be the easier way.

    Can you give that a shot first?

    Let me know 🙂

    #1425525
    Nina

    I just tried it. It didn’t work. When inspecting the site the widget title is still h2.

    The code i use is:

    add_filter( 'generate_start_widget_title', function() {
        return '<h4 class="widget-title">';
    } );
    
    add_filter( 'generate_end_widget_title', function() {
        return '</h4>';
    } );

    I found this in another support thread. Is there a problem with the code?

    #1425531
    Leo
    Staff
    Customer Support

    That code should work.

    Did you clear your caching plugins?

    #1425556
    Nina

    I just double checked clearing my cache. Nothing changed. Is there somewhere special I should put the shortcode I got from the code snippet plugin?

    #1425568
    Leo
    Staff
    Customer Support

    Is there somewhere special I should put the shortcode I got from the code snippet plugin?

    There shouldn’t be any shortcodes.

    All you should need to do is to install and activate Code Snippets, create a new snippet, copy and paste the code above then save and publish to run in the entire site.

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