Site logo

Archived topic

Change the footer widgets titles from h2 to simple

14 replies · Started by Sam on May 7, 2018

Viewing posts 1–15 of 15

Hello everyone,

I am developing a WordPress site using GP + GP Premium, I want to change the footer widgets titles tags from <h2> to <p>.

In my child theme i did create a (inc folder) and put the footer.php inside it and changed the tags but it didn't work.

Thank you so much :)

Thank you David,

That was helpful, but is there any way to change it editing the footer.php inside the INC FOLDER?

Thank you

I did use Tom's method but it didn't work ...

add_filter( 'acs-footer-widgets-titles','generate_start_widget_title' );
function generate_start_widget_title()
{
return '<p class="widget-title">';
}

add_filter( 'generate_end_widget_title','generate_end_widget_title' );
function generate_end_widget_title()
{
return '</p>';
}

Am I doing anything wrong here?

Try:

add_filter( 'generate_start_widget_title', 'db_start_widget_title' );
function db_start_widget_title()
{ 
    return '<p class="widget-title">';
}

add_filter( 'generate_end_widget_title', 'db_end_widget_title' );
function db_end_widget_title()
{ 
    return '</p>';
}

Hey David,

Thank you so much that worked perfect :)

Thats great to hear. Glad i could help

I tried to add this as an Element, but all that happened was the code appeared at the bottom of the page. I created it as a Hook, and checked "Execute PHP". What do I need to do to make this work?

See https://www.screencast.com/t/LYmna7iJPj5

Got it. I thought since a Hook had an "Execute PHP" checkbox that it would have worked.

You're welcome.

Hello,
Can you please confirm if the following code needs to be added to footer.php or functions.php? I basically need to change titles of footer widgets (like recent comments, copyright statement etc) to <p> from the default <h2>.

Thanks in advance!

add_filter( 'generate_start_widget_title', 'db_start_widget_title' );
function db_start_widget_title()
{ 
    return '<p class="widget-title">';
}

add_filter( 'generate_end_widget_title', 'db_end_widget_title' );
function db_end_widget_title()
{ 
    return '</p>';
}

I had to do the same thing for a customer. Found this solution with Google in less than 60 seconds, and it worked perfectly. Great support forum. And such a neat solution. Most themes would need some modification of the original template. As always, GP is much better! Thanks a lot!

Glad to hear you found it useful!

This archived topic is closed to new replies.