WordPress 4.4 responsive sometimes doesn’t work

Got it working by removing the <a href> from the image. This is the proper way of doing a responsive image with a link: <a href=”https://wordpress.stackexchange.com/questions/212844/<?php the_permalink(); ?>”> <picture> <source srcset=”https://wordpress.stackexchange.com/https://wordpress.stackexchange.com/https://wordpress.stackexchange.com/<?php echo get_template_directory_uri(); ?>/img/noimg-499px” media=”(max-width: 599px)”> <source srcset=”https://wordpress.stackexchange.com/https://wordpress.stackexchange.com/https://wordpress.stackexchange.com/<?php echo get_template_directory_uri(); ?>/img/noimg-120×90.jpg” media=”(max-width: 767px)”> <source srcset=”https://wordpress.stackexchange.com/https://wordpress.stackexchange.com/https://wordpress.stackexchange.com/https://wordpress.stackexchange.com/<?php echo get_template_directory_uri(); ?>/img/noimg-220×116.jpg”> <!– fallback –> <img srcset=”https://wordpress.stackexchange.com/https://wordpress.stackexchange.com/https://wordpress.stackexchange.com/https://wordpress.stackexchange.com/<?php echo get_template_directory_uri(); … Read more

add_image_size not working

For this to work, you must have added the thumbnail support. You can use the following code in functions.php to add the support add_theme_support( ‘post-thumbnails’ ); add_image_size(‘poster-full’, 450, 9999, false); and to display the image: if ( has_post_thumbnail() ) { the_post_thumbnail(“poster-full”); }else{ echo “No thumbnail”; }

Category page with thumb is ok but can’t do the same with tags

What am i missing? ‘tag’ may be a valid argument for get_posts() via WP_Query, but requires the tag slug in that case. Try using ‘tag_id’ instead. get_posts() apparently enables ‘category’, but expects the the ID, even though in WP_Query the same argument is ‘cat’ (vs. ‘category_name’, et al). A little confusing, perhaps, altogether. I know … Read more

Post Title to featured Image ALT

If $size is already an array in your original code as it looks to be, then the argument passed will become array(array(150,150)) instead of just array(150,150) and fail, so you can just do: <?php $title=get_the_title(); the_post_thumbnail( $size, array( ‘alt’ =>$title) ); ?>