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

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.

Display a div only in some author’s single posts

is_author() isn’t working as you expect because it checks whether the current query is for an existing author archive page. If you’re placing your code in single.php inside the loop, you can use this instead: <?php if( $post->post_author == ’15’ || $post->post_author == ’16’ ) { ?> <div>Your code here</div> <?php } ?>

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