- This topic has 7 replies, 2 voices, and was last updated 4 years, 9 months ago by
Ying.
-
AuthorPosts
-
June 24, 2021 at 9:08 am #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.June 24, 2021 at 9:43 am #1833775Ying
StaffCustomer SupportHi 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-heightBut 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
widthandheightvalue to match your current logo setting.How to add PHP: https://docs.generatepress.com/article/adding-php/
Let me know if this helps 🙂
June 25, 2021 at 1:23 am #1834364Oliver
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!
June 25, 2021 at 9:35 am #1834972Ying
StaffCustomer SupportFor 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?
June 25, 2021 at 12:37 pm #1835142Oliver
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.June 25, 2021 at 5:02 pm #1835299Ying
StaffCustomer SupportHi 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=98In 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 🙂
June 28, 2021 at 4:25 am #1837236Oliver
Hallo Ying,
ich habe das gewünschte Ziel erreicht!
Vielen Dank für die Hilfe.Viele Grüße
June 28, 2021 at 9:01 am #1837686Ying
StaffCustomer SupportGreat!
Really glad to hear that 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.