- This topic has 22 replies, 4 voices, and was last updated 4 years, 5 months ago by
Tom.
-
AuthorPosts
-
October 13, 2015 at 5:38 am #143920
Reinhold
Hi Tom!
Could it be that the “Footer Widget 3” is gone…?
The rest of them still works, just not #3.October 13, 2015 at 5:48 am #143924Reinhold
Interesting: #3 is gone for me and 4 and 5 only show their default text when I try to use them and put something in there…
October 13, 2015 at 5:53 am #143925Reinhold
Solved. Sorry, don’t know, what it was, but the effect disappeared.
October 13, 2015 at 10:39 am #144004Tom
Lead DeveloperLead DeveloperInteresting – glad it’s back to normal now π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentOctober 27, 2018 at 9:37 am #711950Enrique
Hi guys!
For SEO reasons, I need to change my widgets tittles on the footer, from <h2> to div.
I’m on footer.php file, but I don’t know how to add the documentation filter, neither in which part of the file should be placed. Also, I deduct that the code is written in order to get an <h4> for widget tittles, but my source code tells me that they are actually in <h2>.What I see on my footer.php:
/** * Build our individual footer widgets. * Displays a sample widget if no widget is found in the area. * * @since 2.0 * * @param int $widget_width The width class of our widget. * @param int $widget The ID of our widget. */ function generate_do_footer_widget( $widget_width, $widget ) { $widget_width = apply_filters( "generate_footer_widget_{$widget}_width", $widget_width ); $tablet_widget_width = apply_filters( "generate_footer_widget_{$widget}_tablet_width", '50' ); ?> <div class="footer-widget-<?php echo absint( $widget ); ?> grid-parent grid-<?php echo absint( $widget_width ); ?> tablet-grid-<?php echo absint( $tablet_widget_width ); ?> mobile-grid-100"> <?php if ( ! dynamic_sidebar( 'footer-' . absint( $widget ) ) ) : ?> <aside class="widget inner-padding widget_text"> <h4 class="widget-title"><?php esc_html_e( 'Footer Widget', 'generatepress' );?></h4> <div class="textwidget"> <p> <?php printf( // WPCS: XSS ok. /* translators: 1: admin URL */ __( 'Replace this widget content by going to <a href="%1$s"><strong>Appearance / Widgets</strong></a> and dragging widgets into this widget area.', 'generatepress' ), esc_url( admin_url( 'widgets.php' ) ) ); ?> </p> <p> <?php printf( // WPCS: XSS ok. /* translators: 1: admin URL */ __( 'To remove or choose the number of footer widgets, go to <a href="%1$s"><strong>Appearance / Customize / Layout / Footer Widgets</strong></a>.', 'generatepress' ), esc_url( admin_url( 'customize.php' ) ) ); ?> </p> </div> </aside> <?php endif; ?> </div> <?php }
And here is what my source code prints:
<aside id="media_image-2" class="widget inner-padding widget_media_image"><h2 class="widget-title">My tittle text</h2><img width="170" height="249" src="https://MyPictureOnTheWidget.png" class="image wp-image-2244 attachment-full size-full" alt="More text" style="max-width: 100%; height: auto;" /></aside>
Is there any paragraph I could add to the php file to solve this?
Thank you in advance, have a nice weekend!October 27, 2018 at 10:04 am #711983Tom
Lead DeveloperLead DeveloperHi there,
You just need to add this code to your site:
add_filter( 'generate_start_widget_title', function() { return '<h4 class="widget-title">'; } ); add_filter( 'generate_end_widget_title', function() { return '</h4>'; } );
You can add it using one of these methods: https://docs.generatepress.com/article/adding-php/
Note that we use
<h2>
elements by default for accessibility purposes.Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentOctober 29, 2018 at 5:36 am #712939Enrique
Hi Tom,
Thank you so much for your quick answer (as always), this theme deserves not a 5 but a 6 stars rating! π
I’ve just done it via code snippet, and it works great.Thank you again. Have a nice day!
October 29, 2018 at 10:03 am #713293Tom
Lead DeveloperLead DeveloperGlad I could help! π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-development -
AuthorPosts
- You must be logged in to reply to this topic.