Check if user registered more than a month ago

You can try this: /** * Is the current user registred for more than x days ago? * * Based on the compare idea in this answer: * http://stackoverflow.com/a/7130744/2078474 * * @link http://wordpress.stackexchange.com/a/143597/26350 * @param int $reg_days_ago * @return bool */ function is_user_reg_matured( $reg_days_ago = 30 ) { $cu = wp_get_current_user(); return ( isset( $cu->data->user_registered … Read more

Has is_archived() for sites in a multisite changed with WP 4.7?

Can you try out the following code somewhere and post the output? $mySites = wp_get_sites($args); foreach ($mySites as $blog){ print_r(get_blog_status($blog[‘blog_id’], ‘archived’)); } If this works, I suspect the code behind is_archived() used to understand blog-objects, but the function is supposed to recieve only the blog ID, not the whole object. Your code should be the … Read more

add styles if custom header was included

get_header has an action hook called, (surprise!) get_header which gets a single parameter – the name of the header file. So what we do is check that name and if it matches our name we add a style. So something like this: add_action( ‘get_header’, ‘wpse_260353_add_css_for_header’ ); function wpse_260353_add_css_for_header( $name ){ if( ‘modern’ === $name ){ … Read more

is singular and is home not working

Put condition inside your function: add_action(‘before_footer’,’post_prev_nex’); function post_prev_nex() { if (is_singular()) the_post_navigation(); } In your version is_singular() is executed when functions.php file is loaded, not while displaying the page.

Try to run a function only on Home

You’re calling it on the wrong hook, and you’re calling the wrong conditional function to test. When the after_setup_theme hook is fired, WordPress hasn’t finished processing wether you’re on a page or a homepage yet. You should also never pass in hardcoded post IDs. In this case is_home works, as might is_front_page. If you really … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)