If you can’t edit your header.php, or would prefer not to, most decent WordPress themes should have (and certainly any that pass theme review to be in the official repository)
<html <?php language_attributes();?> >
in the opening html tag in the header.php template.
There is a filter in the language_attributes()
function that allows plugins/child themes to modify the ouput, like so:
function wpa89133( $output ) {
$output .= ' myprop1="val1" myprop2="val2"';
return $output;
}
add_filter( 'language_attributes', 'wpa89133' );
Related Posts:
- Custom plugin – $post_id in wp_head
- Modifying meta tags after doing ajax call in plugin
- making a plugin that moves other plugins wp_head actions to wp_footer
- Include HTML (Bootstrap Modal Box) with a plugin into my header
- How to replace the existing metatag using the backend to insure a thumbnail image gets fetched when we share on social media?
- How do I get a reference to the HTML memory buffer while the page is being constructed?
- Reading the inside of
- Get page content using slug
- How to include wp-load.php from any location?
- Correct way to enqueue jquery-ui
- How to echo the_excerpt without the P tag wrapper?
- How can I update a wordpress plugin from a Git repository (github)
- Is There a Plugin Life Cycle Documentation?
- What is an alternative method to the WordPress private _doing_it_wrong() function
- Shortcode adding p and br tags
- Using AJAX in a plugin to submit form – REALLY confused
- Problems with localization
- Install and load additional plugins when running unit tests
- Having Problem On Getting WP Post Gallery Images URL
- How do I hook a custom discount to change a WC_Order price total on WooCommerce?
- Properly licensing a plugin that uses Apache 2.0 licensed code
- How to restrict plugin’s sub-menu pages to admin/subscribers?
- Can I dynamically create a link to my plugin settings/options page from my plugin description?
- How to load the plugin only when logged in?
- Self-hosted plugin update problems
- Saving data from block editor to the database
- Cannot search post by taxonomy
- Hook into theme-switching later than `setup_theme`
- Save image as featured image
- Best choice of options/settings framework for plugin/theme development
- OOP Plugin and Menu – Call to undefined function register_setting()
- Will current_theme_supports return TRUE with a nonstandard add_theme_support?
- WP AJAX is not working, always returns 0
- Act on user meta updated, but only once
- get_pages Drop down list for selection of a page
- Admin auto-refresh is interfering with Firebug — how to prevent it?
- Hide plugin dashboard menu item for specific roles
- Display content from custom post without modifying the single template
- How do I add custom column to woocommerce cart?
- WordPress mode for emacs?
- Widget translation on my plugin
- Upload to a remote server using wp_remote_post
- Loading WordPress Admin Environment
- how to add custom functionality after woocommerce place order button
- Problems with: manage_${post_type}_posts_columns
- Make WordPress cache permanent for some pages until edited
- Getting timestamp of activation plugin time
- conditionally load javascript & CSS for do_action() calls from plugin
- Rich text editor settings persist throughout all rich text editors
- Function: Add link to / inside div
- How can I rewrite a URL to pass requests to a custom method via AJAX? (I can’t use admin-ajax.php)
- WP Gutenberg Blocks – How to limit first/root blocks
- The plugin does not save data
- How do I create plugin or theme using MVC pattern?
- Create custom HTML/JS app inside page
- How to Get Current Custom Post Type Associated Taxonomy Term
- tinymce.get() returns error after ajax request
- Access bloginfo, get_option, and plugins_url from a non-core php file
- Upload multiple images and insert them into custom html code
- wp_schedule_event() set daily, but processed every second
- Can’t get AJAX call working in custom plugin
- Empty Pdf file generated with FPDF library in WordPress plugin [closed]
- $wpdb->update() always need a second try
- Why aren’t some plugin styles loading when I load a template?
- Pagination not working with custom wp_query
- My plugin won’t create table in wordpress 3.5
- Remove Permalink Meta Box not working?
- WordPress actions for plugin admin UI page
- wp_insert_user keeps echoing values
- Getting posts by taxonomy
- Pause plugin option page until all data manipulation is complete
- Modify custom block plugin without losing content
- Exclude Woocommerce Product Category From Sitemap
- apply_filters() and call_user_func() to define and call a function outside a class
- How to show only the last two categories in a menu?
- HTML Elements in my WP Plugin being generated in JS. Security and Translated Text Question about this method being used
- howTo let wordpress endpoint return html-page
- Sanitization and validation input fields – Settings API
- User meta query using Wildcard
- use a (Polymer) web component within a plugin (or theme)?
- Warning: Illegal string offset ‘Andorra’ in … on line 106
- wp_ajax add_action fuction won’t fire on custom jQuery action
- wordpress4.8.2 Multilingual Plugin
- Customize WordPress Admin Menu
- Dedicated server and WPDB Class : huge slow-down of the website
- $wpdb how can i save my postmeta table before querying it
- Create dedicated page with custom template showing custom data
- How can I see a varibles value when my plugin runs?
- Add Button to TinyMCE Custom Menu
- How should I use wpdb class to submit a form in admin dashboard?
- WordPress plugin: admin-ajax.php not passing data to custom function
- How do I replace title with my plugin?
- Create pages for authors
- How do I create Widget within plugin that uses its own class?
- Looking for Hook that is fired after a plugin or wp upgrade is installed/updated
- How to design WooCommerce-like admin tabs for plugin settings page?
- Woocommerce: block user removing cart item
- How can I dynamically change title and description in WordPress?
- Load images from CDN and custom features to “Add Media” dialogue
- Saving metabox updates causing fatal error