has_post_thumbnail() Returns False on Scheduled Posts

Well it turns out that the reason has_post_thumbnail() was failing was because get_post_meta() was returning empty for scheduled posts. I’m still not sure why, but in case someone else has the issue, my workaround was to create a new function to fetch the featured image ID without relying on get_post_meta(): function get_featured_image_id($postID) { global $wpdb; … Read more

Comments on pages not appearing, even though I enabled them

As @SaurabhShukla mentioned in one of the comments, the problem was probably the theme. I use Virtue. Its great and got tons of options, and in one of them, under misc settings (a place which is totally unlooked-for), sits an option/out button. Hope this will help someone else in the future. Thank you all for … Read more

Display post content from category name using ajax

add_action( ‘wp_ajax_nopriv_load-filter’, ‘prefix_load_cat_posts’ ); add_action( ‘wp_ajax_load-filter’, ‘prefix_load_cat_posts’ ); function prefix_load_cat_posts () { global $post; $cat_id = $_POST[ ‘cat’ ]; $args = array ( ‘cat’ => $cat_id, ‘posts_per_page’ => 3, ‘order’ => ‘ASC’ ); $cat_query = new WP_Query($args); if($cat_query->have_posts()) : while($cat_query->have_posts()) : $cat_query->the_post(); $response=”<div class=”the-post”>”; $response .= ‘<h1 class=”the-title”>’; $response .= ‘<a href=”#”>’. get_the_title() .'</a>’; $response … Read more