How to add Support to show Fullwidth Featured Image of Custom Post Types in WordPress.?

This happens when the image does not have a specific width/height. The image you try to load in your custom-post-type is too small (379x354px). So LinkedIn, Facebook or others will use the layout with the smaller image. Facebook says: Images that are at least 470×246 pixels will display as a rectangle with the title and … Read more

Broken thumbnails (sometimes) with TimThumb

99% of the issues I’ve had similar to this were when TimThumb simply ran out of memory. There’s usually a direct correlation between image size and memory usage. The bigger the image is, the higher the chances it will run out of memory. To get a better idea of the error, access the timthumb url … Read more

Replace TimThumb in existing WordPress Themes

You have three options here: Use the_post_thumbnail() You say you’ve already done this with one theme. This is really the best solution because it keeps everything using core code (which is frequently updated) rather than third-party libraries. Upgrade TimThumb Since the “most recent” issues, they’ve released a new version of TimThumb that corrects the security … Read more

Exclude Multiple Post Thumbnails From Post Attachments

$thumb_id = get_post_thumbnail_id(get_the_ID()); $bg_id = MultiPostThumbnails::get_post_thumbnail_id(‘work’, ‘background-image’, $post->ID); $args = array( ‘post_type’ => ‘attachment’, ‘numberposts’ => -1, ‘post_status’ => null, ‘post_parent’ => $post->ID, ‘exclude’ => array($thumb_id, $bg_id) );

wp_get_attachment_image_src() with advanced custom fields returning empty

What’s in get_sub_field(‘image’)? wp_get_attachment_image_src() parameter 1 should be the attachment id, not the attachment src, if that’s what you have. I use the following function to get an attachment ID from an image url as as far as I know WP doesn’t have a method for this at present. function get_attachment_id_from_src ($src) { global $wpdb; … Read more

Stop ‘alt’ from being added to the_post_thumbnail

If you look here: http://codex.wordpress.org/Function_Reference/the_post_thumbnail you will see that you can change the alt. You have to add an array with the value for the alt in the second parameter like so: <?php the_post_thumbnail(‘thumbnail’, array( ‘alt’ => false )); ?>

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