Site logo

[Resolved] ARIA Label von Logo ändern

Home Forums Support [Resolved] ARIA Label von Logo ändern

Home Forums Support ARIA Label von Logo ändern

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1833724
    Oliver

    Hi,

    Wie ist es möglich, ein ARIA Label von dem Logo der Website zu ändern?
    Der Name sollte vom Screenreader zum Beispiel mit “Zur Startseite wechseln” ausgegeben werden.
    Danke für einen Lösungsansatz.

    #1833775
    Ying
    Staff
    Customer Support

    Hi Oliver,

    Here’s a filter that can alter the logo html output, it’s mainly for changing the size of logo.
    https://docs.generatepress.com/article/generate_logo_output/#setting-a-width-and-height

    But you can also add the aria label to the php:

    For example:

    add_filter( 'generate_logo_output','tu_logo_atts', 10, 2 ); 
    function tu_logo_atts( $output, $logo ) {
    	printf(
    		'<div class="site-logo">
    			<a href="%1$s" title="%2$s" rel="home">
    				<img width="200" height="200" class="header-image" src="%3$s" alt="%2$s" title="%2$s" aria-label="Zur Startseite wechseln"  />
    			</a>
    		</div>',
    		esc_url( apply_filters( 'generate_logo_href' , home_url( '/' ) ) ),
    		esc_attr( apply_filters( 'generate_logo_title', get_bloginfo( 'name', 'display' ) ) ),
    		esc_url( apply_filters( 'generate_logo', $logo ) )
    	);
    }

    Change the widthand height value to match your current logo setting.

    How to add PHP: https://docs.generatepress.com/article/adding-php/

    Let me know if this helps 🙂

    #1834364
    Oliver

    Hallo Ying,

    über das Plugin Code Snippets habe ich es hinbekommen.
    Das Hinzufügen des Filters über ein Child Theme und die zugehörige functions.php war nicht erfolgreich.
    Ich hoffe, dass das Plugin Code Snippets nicht die Performance insgesamt belastet.

    Mit welchem Filter kann man die ARIA Labels von Social Media Icons im Footer ändern?

    Danke!

    #1834972
    Ying
    Staff
    Customer Support

    For the social icons in the footer, I don’t think PHP is needed.

    Could you link me to your site using the private info field?

    #1835142
    Oliver

    Hallo Ying!

    Die Icons im Footer sind bereits eingebaut. Es gibt auch ARIA Labels, aber ich würde sie gern anders nennen.
    Anstelle “LinkedIn Link” sollte “Firmenname auf LinkedIn” vom Screenreader erkannt und gelesen werden.
    Den Link findest du im privaten Infofeld.

    #1835299
    Ying
    Staff
    Customer Support

    Hi Oliver,

    Seems the social icons are added with Light weight social icons, this plugin was created by Tom, but now it’s kinda out of date.

    I would recommend using Generateblocks plugin, and use Block element to add the social icons instead.

    Buttons block of Generateblocks: https://docs.generateblocks.com/article/buttons-overview/#aria-label

    In this way, you are allowed to add ARIA label to each icons.

    Here’s a tutorial video about how to add social icons to top bar using Generateblocks.
    https://youtu.be/yAleVWQi5EA?t=98

    In your case, you will use Hook as element (same as in the video), use before footer as hook name (different from the video).

    Let me know if this helps 🙂

    #1837236
    Oliver

    Hallo Ying,

    ich habe das gewünschte Ziel erreicht!
    Vielen Dank für die Hilfe.

    Viele Grüße

    #1837686
    Ying
    Staff
    Customer Support

    Great!

    Really glad to hear that 🙂

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