Archived topic
Checkbox and option inputs CSS
13 replies · Started by Fernando on April 23, 2019
Hello and good day!
Is there any theme class (or styles) to change the default (and ugly) checkbox and option form inputs?
Another question: how can we remove the title attribute in the site logo and navigation logo links? Or is it important?
Note that I send you the URL, dont publish as the site is not published.
Thanks!
Hi there,
do you have any example of how you would like the input fields and checkbox to be displayed?
Some are difficult to change as they default to the browser styles.
The Title Attribute is important for SEO optimization. I would not recommend removing it.
Hello David, how can we remove the title attribute?
Tom provides the solution here:
https://generatepress.com/forums/topic/remove-title-attribute-from-logo-2/#post-816077
Ok, thank you!
But is there a way to change also the title attribute in the navigation logo?
About checkbox and option styles, would be fine that GP include them.
Change the title or remove it?
You can try this:
add_filter( 'generate_logo_title', '__return_empty_string' );
Hello Tom,
The problem is that the filter generate_logo_title not only removes the title attribute, also the alt attribute, and this is the important (not the title) for SEO and accesibility purposes.
* Is there anyway to remove (or change) the title attribute for the header logo and for the site logo, but not the alt attributes? *
You can think this is not important, but I see annoying the title emergent message over the image.
Thank you!
Ah, gotcha.
Ok, let's try this:
add_filter( 'generate_logo_attributes', function( $atts ) {
unset( $atts['title'] );
return $atts;
} );
add_filter( 'generate_navigation_logo_output', function() {
return sprintf(
'<div class="site-logo sticky-logo navigation-logo">
<a href="%1$s" rel="home">
<img src="%2$s" alt="%3$s" />
</a>
</div>',
esc_url( apply_filters( 'generate_logo_href' , home_url( '/' ) ) ),
esc_url( apply_filters( 'generate_navigation_logo', $settings['sticky_menu_logo'] ) ),
esc_attr( apply_filters( 'generate_logo_title', get_bloginfo( 'name', 'display' ) ) )
);
} );
I am going to try, thank you!!!
No problem :)
Hello Tom,
I only have implemented the generate_logo_attributes filter, due to the complexity of the other.
generate_logo_attributes: note that when unset($atts['title']), appears the logo link title (in Chrome and Firefox), so it is the same story... :-(. It is solved with $atts['title']='' instead of unset.
I think title attributes shouldn't be used in that area, neither in links nor in images (or give the possibility of change), as the only important are the alt of the images.
A lot of thanks!
I tend to agree. I'll look at removing them :)
Ok, take note. Thanks!
You're welcome! :)