Hooks not working on live server

get_footer hook fires before the footer template file is loaded. Note: This hook is best to use to set up and execute code that doesn’t get echoed to the browser until later in the page load. Anything you echo will show up before any of the markup is displayed. Besides, make sure you call the … Read more

wp_footer content appearing in admin area

That’s because you’re not using add_action correctly, what you’ve written is functionally the same as this: function xyz_footer_print() { echo ‘footer script here’; } $value = xyz_footer_print(); add_action( ‘wp_footer’, $value ); xyz_footer_print() immediately runs the function and returns nothing. As a result your add_action call says that on the wp_footer even, do nothing. So you … Read more

How to display before H1 Title

Try to use filter like add_filter(‘the_title’, ‘new_title’, 10, 2); function new_title($title, $id) { if(‘your-post-type’ == get_post_type($id)) $title=”Add your DIV block here”; $title .= $title; return $title; }

How to use the password_reset hook to validate new password and display error

You can try using hook the validate_password_reset to validate password. Following code can be used to validate alphanumeric password. add_action(‘validate_password_reset’,’wdm_validate_password_reset’,10,2); function wdm_validate_password_reset( $errors, $user) { $exp = ‘/^(?=.*\d)((?=.*[a-z])|(?=.*[A-Z])).{6,32}$/’; if(strlen($_POST[‘pass1’])<6 || !preg_match($exp, $_POST[‘pass1’]) ) $errors->add( ‘error’, ‘Password must be alphanumeric and contain minimum 6 characters.’,”); }

How do I change TinyMCE button “i” to create a i tag rather than em? [duplicate]

Here’s a simple function that will replace <em> with <i> on your post/page: function replace_em_with_i($content) { $content = str_replace(‘<em>’, ‘<i>’, $content); $content = str_replace(‘</em>’, ‘</i>’, $content); return $content; } add_filter(‘the_content’, ‘replace_em_with_i’); Warning: I have tested the code to check if it works (and it does work), but you might want to do some serious testing … Read more