WordPress Post undefined error with Post Date (New to Wordpres Dev)

To just get the post date, you can replace that entire section of code with just the get_the_date() function. To display the article’s date, use this code: <?php echo get_the_date(); ?> Check out the date format options on the codex page linked above to customize it to your liking, if necessary.

PHP error after theme update

This type of error generally occurs when the index is not set in the array. You can use the function isset in if like if( isset ( $array[‘focus’] ) && !empty( $array[‘focus’] ) ){ }. This code will first check either the index focus exists in the $array or not. If the index exists then … Read more

Related Posts: if there is no category use tags

There is no mistake in code it is not working because of just comma mistake use this i have made charges into it. function dtwd_related_posts_shortcode($atts){ extract(shortcode_atts(array( ‘count’=> ‘3’, ‘title’ => ‘More useful tips’, ), $atts)); global $post; $current_cat = get_the_category($post->ID); $current_cat = $current_cat[0]->cat_ID; $this_cat=””; $tag_ids = array(); $tags = get_the_tags($post->ID); if ($tags) { foreach($tags as … Read more