- This topic has 14 replies, 4 voices, and was last updated 2 years, 9 months ago by David.
-
AuthorPosts
-
May 7, 2018 at 5:39 am #569532Sam
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 π
May 7, 2018 at 5:47 am #569549DavidStaffCustomer SupportYou can use filters to change the tags, here is a post from Tom:
https://generatepress.com/forums/topic/footer-widget-heading-h2/#post-474609
Let me know if this helps.
May 7, 2018 at 5:55 am #569552SamThank you David,
That was helpful, but is there any way to change it editing the footer.php inside the INC FOLDER?
Thank you
May 7, 2018 at 6:00 am #569558SamI 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?
May 7, 2018 at 6:24 am #569575DavidStaffCustomer SupportTry:
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>'; }
May 7, 2018 at 8:44 am #569822SamHey David,
Thank you so much that worked perfect π
May 7, 2018 at 8:57 am #569833DavidStaffCustomer SupportThats great to hear. Glad i could help
September 27, 2018 at 3:15 pm #688122MartinI 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?
September 27, 2018 at 4:06 pm #688132DavidStaffCustomer SupportHi Martin,
This article covers adding PHP:
https://docs.generatepress.com/article/adding-php/
If you’re not using a Child Theme then the linked Code Snippets plugin is a great alternative.
September 27, 2018 at 5:13 pm #688162MartinGot it. I thought since a Hook had an “Execute PHP” checkbox that it would have worked.
September 27, 2018 at 5:36 pm #688178DavidStaffCustomer SupportYou’re welcome.
February 28, 2021 at 9:06 pm #1676711BelindaHello,
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>'; }
February 28, 2021 at 11:04 pm #1676754ElvinStaffCustomer SupportHi Belinda,
See my reply on your topic here:
https://generatepress.com/forums/topic/change-footer-widget-titles-from-h2-to-paragraph/#post-1676750Thanks. π
July 5, 2021 at 8:31 am #1845388mkjjI 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!
July 5, 2021 at 8:53 am #1845427DavidStaffCustomer SupportGlad to hear you found it useful!
-
AuthorPosts
- You must be logged in to reply to this topic.