Thumbnails and Lightbox

Thank you Jeremy Jared. I applied the following solution, based on yours ( Any good lightbox-like option that works in WP 3.2.1? ) First of all, now I call my thumbnail with the following code instead of trying to add the link myself: wp_get_attachment_link(get_post_thumbnail_id(), ‘thumbnail’); Then, I add your filter in function.php /************************* * Lightbox … Read more

Automatic adding thumbnail to post

This should work: $wp_upload_dir = wp_upload_dir(); $fileurl = “http://damianc.pl/th.jpg”; $filename = $upload_dir[‘path’] . DIRECTORY_SEPARATOR . basename( $fileurl ); if ( file_put_contents( $filename, file_get_contents( $fileurl ) ) ) { require_once(ABSPATH . ‘wp-admin/includes/image.php’); $wp_filetype = wp_check_filetype(basename($filename), null); $attachment = array( ‘post_mime_type’ => $wp_filetype[‘type’], ‘post_title’ => preg_replace(‘/\.[^.]+$/’, ”, basename($filename)), ‘post_content’ => ”, ‘post_status’ => ‘inherit’ ); $attach_id = … Read more

I would like my posts to pull my custom cropped thumbnail instead of creating its own thumbnail from Featured Image

If your theme is using the_post_thumbnail() to display the featured image, adding the following code in functions.php file will display the Thumbnail size of the image (as set on Settings -> Media Settings): add_filter(‘post_thumbnail_size’, ‘my_thumbnail_size’); function my_thumbnail_size() { return ‘thumbnail’; } Or you can display the featured image in any width (X) or height (Y) … Read more

Imagem resolution responsive

You can use the timthumb for resize your images as you want. if ( has_post_thumbnail() ) { // get the src of the large size featured image $src = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), ‘large’ ); $thumbnailSrc = $src[0]; // output image resized with timthumb ?> <a href=”https://wordpress.stackexchange.com/questions/97632/<?php echo get_post_meta($postid,”post_link’, true) ?>” target=”_blank”> <img src=”<?php bloginfo(‘template_directory’); ?>/js/timthumb.php?src=<?php echo … Read more

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