Auto resize images after adding a new size

WordPress doesn’t regenerate the newly registered size, only applies it to future uploads. You’ll have to use something like the Regenerate Thumbnails plugin or one of the similar ones available at WordPress.org.

function to show only featured image of the posts

I am not sure that a filter on the_content is the way to go here. If I understand you, I think that all you need is something like the following your theme– cribbed from the two Codex pages listed below and altered slightly. if ( has_post_thumbnail() ) { // check if the post has a … Read more

Image popup in a lightbox / overlay from the backend 3.5 admin area (plugin)

You can just use the built in ThickBox. Maybe not the pretties library but it does its job. Just add the class thickbox to the link and add the image to the href Here is a simple example: <?php echo ‘<a href=”https://wordpress.stackexchange.com/questions/78749/image.png” class=”thickbox”>’. __(‘Test image’, ‘domain’) .'</a>’; ?> Read more about ThickBox here.

Shortcode for a link and thumbnail

You are assigning the attachment URL to your $url variable: $url = wp_get_attachment_url( get_post_thumbnail_id( $id ) ); then passing that same variable back to wp_get_attachment_url: return ‘<img src=”‘ . wp_get_attachment_url( $url ) . ‘”/><a href=”‘ . get_permalink( $id ) . ‘”>’ . get_the_title( $id ) . ‘</a>’; You should simply output it instead: return ‘<img … Read more

Get meta data from image

Image data is stored as if it were a post, or a CPT, so you can treat it like one. $album_id = get_the_id(); $img = new WP_Query(array(‘p’=>$album_id,’post_type’=>’attachment’)); var_dump($img->posts[0]->post_content); Or, a little more complicated,… $album_id = get_the_id(); $img = new WP_Query(array(‘p’=>$album_id,’post_type’=>’attachment’)); if (!empty($img->posts[0])) { var_dump($img->posts[0]->post_content); } get_the_ID will return the ID of the current post so … Read more

Image resize using url parmater

WordPress(.org) doesn’t have anything like this built into the core. A lot of theme developers use Timthumb to achieve that. The example you’ve linked to is on a wordpress.com server so there will be something custom going on for that functionality. You could also look at the WordPress functions add_image_size & the_post_thumbnail.

wp_get_attachment_url with specific image_size?

You can use single_product_large_thumbnail_size Woocommerce filter as shown in following code to apply custom image size for product. In the above code replace this apply_filters( ‘single_product_large_thumbnail_size’, ‘shop_single’ ) with this apply_filters( ‘single_product_large_thumbnail_size’, ‘custom_thumbnail_size’ );

How to change the target size of images clicked on in WordPress standard gallery

I came across a solution for your functions.php from the following site that looks like it will do the trick. More detail on the implementation here: http://oikos.org.uk/2011/09/tech-notes-using-resized-images-in-wordpress-galleries-and-lightboxes/ Snippet below: function oikos_get_attachment_link_filter( $content, $post_id, $size, $permalink ) { // Only do this if we’re getting the file URL if (! $permalink) { // This returns an … Read more

Custom image sizes without add_image_size()

Docs, docBlocks and Codex … Basically you have a very simple mistake: The $attributes array is the 2nd argument: function the_post_thumbnail( $size=”post-thumbnail”, $attr=”” ) { echo get_the_post_thumbnail( null, $size, $attr ); } How it works internally 1) The HTML itself gets built by wp_get_attachment_image(). 2) Later on, inside this function, the next relevant function call … Read more

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