Benefits to using semantic HTML in post content? [closed]

It’s a little hard to answer this question definitively, but typically, adding semantic markup can benefit SEO (because robots understand what they’re parsing better) and can benefit end users (because their various technologies, which could include screen readers among many others, also understand what they’re parsing better). Search engines and screen readers also often present … Read more

How to Restrict Access to all wp-admin pages for subscriber users

Hence, I want to block access of subscribers to all wp-admin menus/plugin pages including this link https://mywebsite.com/wp-admin/user-edit.php?user_id=113 This isn’t a bulletproof solution, but it should work in that non-admin users would no longer be able to access any admin pages when they’re logged-in: add_action( ‘admin_init’, function () { if ( wp_doing_ajax() || ! is_user_logged_in() ) … Read more

How to create an optionally available stylesheet for visually impared users?

Easy to setup a button trigger/toggle with a bit of jQuery. Here’s a working example I made for you: https://jsfiddle.net/8Le2tjvr/1/ The Code: HTML: <button id=”impaired-button”>Impaired Button</button> jQuery $(‘#impaired-button’).click(function() { $(‘body’).toggleClass(‘impaired’); }); CSS .impaired h1 { font-size: 50px; } Just add .impaired before any css that you want specifically styled for impaired users. This will be … Read more

get_search_form() and aria_label

You can pass an array of attributes with aria_label attribute in it. Try this: get_search_form(array(‘aria_label’ => ‘search-form’)); This function gets a form from searchform.php by default and if you have this file in your theme and aria-label still missing, you need to check the code in this file. Sometimes developers do not include an option … Read more

Add HTML Attributes To Anchor Tags In `wp_list_categories()` Function

The default walker used by wp_list_categories() (Walker_Category) has a hook (a filter hook) named category_list_link_attributes which you can use to add custom title and class (as well as other attributes like data-xxx) to the anchor/a tag (<a>) in the HTML list generated via wp_list_categories(). So for example, you can do something like: add_filter( ‘category_list_link_attributes’, ‘my_category_list_link_attributes’, … Read more

How can I make a site viewable in multiple languages?

If your just looking for a way for your site to be viewed in other languages I would defiantly recommend using Google Translate Tools. I just add it to the theme: <div id=”google_translate_element”><span id=”trans”>Translate: </span></div> You can hide the Google Logo and funky colors in your css: .goog-logo-link{display:none;} Instead of calling the Google Translate js … Read more