Making a parent directory writable by the server

Here is how to change your folder permissions. Login to your ftp Make your wp-content folder 755 (In most FTP programs, this involves right-clicking -> “Permissions”). 755 is owner: read, write and execute permissions; group: read and execute permissions; others: read and execute permissions. Inside wp-content create a new folder called “uploads”, make it 755 … Read more

fitting the thumbnail image into a div

When setting the size of the image in an array using the_post_thumbnail as you are, the documentation states that the ‘crop’ feature does not work as of WordPress 3.0. In order to accomplish what you want, you will need to do the following. In your functions.php file, make a call to add_image_size, which allows you … Read more

Add a span tag around image

try to add a filter function to functions.php of your theme; example: add_filter(‘the_content’, ‘alc_image_spanner’); function alc_image_spanner($text) { $text = preg_replace_callback(“#<img(.*?)>#is”, create_function(‘$matches’, ‘return “<span><img”.$matches[1].”></span>”;’), $text); return $text; }

Output posts attached images as thumbnails linked to full-size with lightbox class

Thanks to @Rarst who led me in the right direction to answer this question! What do you get if you var_dump() return of what doesn’t work, especially wp_get_attachment_img_src()? Do you have WP_DEBUG enabled? – Rarst function product_images() { global $post; $attachments = get_posts( array( ‘post_type’ => ‘attachment’, ‘posts_per_page’ => 0, ‘post_parent’ => $post->ID, ‘exclude’ => … 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