Proper way to remove html code on child theme
Proper way to remove html code on child theme
Proper way to remove html code on child theme
You’re running your code on the wp_loguout hook, which is after the user has logged out, so of course there’s no current user ID. There’s no current user at all. If you look at the documentation for the wp_logout hook, you will see that the ID of the user that was logged out is passed … Read more
Wp_Schedule_Event every few minutes doesn’t work
You could do something like this (this code has not been testedt). function schedule_sql_command($user_login, $user) { // 12 hours in seconds. $from_now = 12 * 60 * 60; // schedule a call to a custom hook passing in the user’s ID wp_schedule_single_event(time() + $from_now, ‘run_sql_command’, array( $user->ID) ); } // this is the custom hook … Read more
Search by date in WordPress
This line (at least) is being output before the cookie can be set: echo ‘<h2>’.$hash.'</h2>’; Sending output to the screen (even empty lines) will prevent cookies being set. From the PHP docs: Like other headers, cookies must be sent before any output from your script (this is a protocol restriction). This requires that you place … Read more
function add custom fields to media gallery
Alt text attributes not showing over portfolio images
What you’re seeing in the admin bar is Pending comments. Without building your own custom admin bar item there isn’t any way to change this easily.
After some further trial and error I discovered the action hook the_post which seems to work in this situation. It updates the background color while still allowing the rest of the page/post content to display.