Replace Header Element on WordPress Login Page
In the Customizing the Login Form page in the WordPress Codex, I found the wp_login_form function, which can be put on a custom page where I can control the markup around the form, just as I need!
In the Customizing the Login Form page in the WordPress Codex, I found the wp_login_form function, which can be put on a custom page where I can control the markup around the form, just as I need!
Classic Themes What wordpress hooks can be used to override how the primary menu is displayed in my wordpress header’s navigation menu — ideally in a way that will work cross-theme. This isn’t possible to do in a cross theme way, and there is nothing in WP that indicates if a hamburger menu is used, … Read more
If remove_action( ‘wp_footer’, ‘the_block_template_skip_link’ ) did not work, then try with remove_action( ‘wp_enqueue_scripts’, ‘wp_enqueue_block_template_skip_link’ );, or both of that. (see source on GitHub) As for changing the href value, I’m not aware of any (filter) hook to do that, but you can either edit your template and set the <main>‘s id value to content-top, or … Read more
Editing alt text in media library
Well, that was easy. leaving here if someone stumbles upon this and it’s useful OR if someone has a better solution. In the comments below – the first if statement designates we only want this to apply to our mega menu which in our case is menu-2 in theme_location of wp_nav_menu // ADD SUBMENU BUTTON … Read more
Gutenberg: Issue trying to commit locally
To get the editor content as a string in the classic editor use this: content = tinymce.activeEditor.getContent(); Taken from https://stackoverflow.com/a/5843951/57482 Note that you should use the APIs provided rather than directly modifying the DOM if you want to modify the content. If you don’t, you won’t update plugins local states in javascript causing problems. Modifying … Read more
Although this is not a WP question, it could be done with some PHP/MySQL code. Just the psuedocode: generate a GUID value on each main page visit check if the GUID is already in the GUID database if not, store the GUID in the GUID database if GUID exists in the database, redirect to another … Read more
Do you want to preserve the images title attribute? If not here is a code that fixes that for you: add_filter(‘the_content’, ‘remove_title_attr’); function remove_title_attr($text) { // Get all title=”…” tags from the html. $result = array(); preg_match_all(‘|title=”[^”]*”|U’, $text, $result); // Replace all occurances with an empty string. foreach($result[0] as $html_tag) { $text = str_replace($html_tag, ”, … Read more
never access theme or plugin files directly in their directory, this is a non secure way to develop code which will be blocked on any server with hardened security. If you need to get information from the site you can either add an ajax access, or json end point in your code for that.