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

Display image title and caption inside a single post

I got a few minutes and made the custom code for you. Copy and paste this in your themes functions.php remove_shortcode(‘gallery’, ‘gallery_shortcode’); add_shortcode(‘gallery’, ‘gallery_shortcode_custom’); function gallery_shortcode_custom( $attr ) { $post = get_post(); static $instance = 0; $instance++; if ( ! empty( $attr[‘ids’] ) ) { // ‘ids’ is explicitly ordered, unless you specify otherwise. if … Read more

Featured Image not changing

Sorry you’re having trouble with the featured image. Some details that will help the community solve the question: What theme are you using? Without knowing what theme you’re using, one approach you might try is removing the featured image from the post/page, then click update. If the featured image is removed, you might then be … Read more

Change the avatar ratio?

Possible sollutions: Use Css with something like overflow: hidden; and “cut out” what you need. Use the filter apply_filters(‘get_avatar’, $avatar, $id_or_email, $size, $default, $alt); and override the output of $avatar completely. The function get_avatar() is pluggable. That means if you hook a plugin function early enough that already defines get_avatar() then this function will be … Read more

Issues with the excerpt (wordcount/HTML/images)

Answer on my own question (without using a plugin and choosing a middle way) for what we want to achieve. Because the template has also a code starting with: if ( has_post_thumbnail() && ( $post->post_type == ‘post’ ) ) we have taken that part of code away. (we won’t used it in postings/pages, therefore) Following … Read more

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