WordPress show bad the php hour and date

Did you go to Settings >> General and set the correct offset for your timezone? To get the date: <?php $date = get_the_time(‘dmY’, $post->ID); ?> To print the date: <?php the_date(‘dmY’); ?> Both need to be within the Loop!

If is_single in functions.php

Generally it’s not a common way to strip wpautop with remove_filter as it is native functionality of WordPress. But if you want to : place the remove_filter() function right before the the_content() function on the pages/templates where you don’t need the wpautop <?php remove_filter( ‘the_content’, ‘wpautop’ ); the_content();?>

how get number of twitter followers in wordpress

You would replace this: $dataOrig = file_get_contents(‘http://twitter.com/users/show/’.$twitter_user); if (is_wp_error($dataOrig)) { return ‘Error!!!’; }else{ $profile = new SimpleXMLElement ( $dataOrig ); $countOrig = $profile->followers_count; $count = strval ( $countOrig ); } With this: $dataOrig = wp_remote_get(‘http://twitter.com/users/show/’.$twitter_user); if (is_wp_error($dataOrig)) { return ‘Error!!!’; } else { $profile = new SimpleXMLElement ( $dataOrig[‘body’] ); $countOrig = $profile->followers_count; $count = … Read more

Change custom featured image size in twentythirteen child theme

The function that handles thumbnail size is already hooked with after_setup_theme in \twentythirteen\functions.php. There is no use adding a if (!function_exists()) in child functions.php because the child functions.php is always loaded before. So this would be more logical to find this in the parent file. The answer would be to set a different prority to … Read more

If no author posts, echo out some text

Maybe this do the trick, put your if statement inside the function to check if the number of posts retrieved is >= 1, if so begin the foreach else print a message function get_related_author_posts() { global $authordata, $post; $authors_posts = get_posts( array( ‘author’ => $authordata->ID, ‘post_type’ => ‘kenniscentrum’, ‘post__not_in’ => array( $post->ID ), ‘posts_per_page’ => … Read more

Custom function for search form

bloginfo( ‘template_url’ ) will print the URL to the page and break the return of your function. You need to use get_bloginfo( ‘template_url’ ) to concatenate the result into the string. function clarity_wpsearch($form) { $form = ‘<form role=”search” method=”get” id=”searchform” action=”‘ . home_url( “https://wordpress.stackexchange.com/” ) . ‘” > <label class=”screen-reader-text” for=”s”>’ . __(‘Search for:’, ‘claritytheme’) … Read more