[Resolved] Checkbox and option inputs CSS

Home Forums Support [Resolved] Checkbox and option inputs CSS

Home Forums Support Checkbox and option inputs CSS

  • This topic has 13 replies, 3 voices, and was last updated 5 years ago by Tom.
Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #876345
    Fernando

    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!

    #876356
    David
    Staff
    Customer Support

    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.

    #876359
    Fernando

    Hello David, how can we remove the title attribute?

    #876367
    David
    Staff
    Customer Support
    #876949
    Fernando

    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.

    #877049
    Tom
    Lead Developer
    Lead Developer

    Change the title or remove it?

    You can try this:

    add_filter( 'generate_logo_title', '__return_empty_string' );

    #877162
    Fernando

    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!

    #877698
    Tom
    Lead Developer
    Lead Developer

    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' ) ) )
        );
    } );
    #877999
    Fernando

    I am going to try, thank you!!!

    #878202
    Tom
    Lead Developer
    Lead Developer

    No problem πŸ™‚

    #878495
    Fernando

    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!

    #879257
    Tom
    Lead Developer
    Lead Developer

    I tend to agree. I’ll look at removing them πŸ™‚

    #879669
    Fernando

    Ok, take note. Thanks!

    #879745
    Tom
    Lead Developer
    Lead Developer

    You’re welcome! πŸ™‚

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