how to resize thumbnail image

First of all: add_image_size() is to ADD a new image size into your WordPress installation. Now, as you said: I just want to resize my Image You need to enter into your wp-admin panel. Then Settings » Media, and change the thumbnail size there. Just change the thumbnail size there. Now use the plugin: Regenerate … Read more

Assign SQL ‘post_thumbnail’ column as featured image

How is the post_thumbnail information stored? If you’ve already created an attachment with the image and are storing the attachment’s postId in post_thumbnail, then you just need to go through your posts and update the meta using update_post_meta($postId, ‘_thubmnail_id’, $attachmentPostId). If post_thumbnail stores the path to an image file on your server, you need to … Read more

get_the_post_thumbnail($post->ID, ‘thumbnail’); not working. How can I solve this?

The problem of showing the thumbnail twice is because of your the_content(); which is defined in the content-page.php file that has the line the_post_thumbnail(); that will get the featured image. so intead of using the the_content() just use the get_the_content() function to get only the content without the featured image. Let me know if that … Read more

WordPress get_categories & listing recent post thumbnail

Did some playing about, managed to get it working. <?php /* Template Name: Festivals – United States */ ?> <?php get_header(); ?> <div id=”left_full”> <?php $args = array( ‘orderby’ => ‘name’, ‘order’ => ‘ASC’, ‘child_of’ => ‘3592’ ); $temp_query = $wp_query; $categories = get_categories($args); foreach($categories as $category) { query_posts(“posts_per_page=1&cat=$category->cat_ID”); if (have_posts()) : while (have_posts()) : … Read more

Getting featured image with direct $wpdb within plugin

That is not how you would query for a featured image. This: $thumb = $wpdb->get_var(“SELECT ID FROM $wpdb->posts where post_parent=”$value” and post_type=”attachment””); Should be: $thumb = $wpdb->get_var(“SELECT meta_value FROM $wpdb->postmeta where meta_key = ‘_thumbnail_id’ and post_id = ‘$value'”); That is assuming that $value is a post ID. “Featured” images are attachments, but not all attachments … Read more

Is wordpress compressing my images? if so, how to prevent it?

A nice explanation is at WPMUdev: http://premium.wpmudev.org/blog/how-to-change-jpeg-compression-in-wordpress/ According to their tutorial, you’d need to add the following to your functions.php add_filter( ‘jpeg_quality’, create_function( ”, ‘return 100;’ ) ); They also suggest regenerating your thumbnails once the change is made so previously uploaded images will be affected by the quality change.

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