wp_get_attachment_link to add title attribute to link tag around image

I found a solution. Since the wp_get_attachment_link does not seem to work I solved this within an already used other filter:img_caption_shortcode Within this filter function the content variable contains the image link tag. Here a just added the title using a simple search and replace: $content = str_replace(“<a”,”<a title=””.$attr[“caption’] . $credit.”‘”, $content); This way it … Read more

Show LightBox when clicking on featured image [closed]

If you use the following code you may fix your problem. Give it a try.Paste this in your post.php <?php if ( current_theme_supports( ‘get-the-image’ ) ): $image_full=wp_get_attachment_image_src(get_post_thumbnail_id( $post->ID ), ‘full’); $image_thumbnail=wp_get_attachment_image_src(get_post_thumbnail_id( $post->ID ), ‘single-thumbnail’); ?> <a href=”https://wordpress.stackexchange.com/questions/194146/<?php echo $image_full[0]; ?>” rel=”lightbox”> <img class=”alignnone wp-image-2770 size-single-thumbnail” src=”<?php echo $image_thumbnail[0]; ?>” alt=”2015-04-10_190211″ width=”636″ height=”460″ style=”opacity: 1;”> </a> … Read more

Add “data-” attribute to image links

while googling about the same issue I came upon your question and a similar question from the WordPress forums. You can control the output of the generated code via the image_send_to_editor filter like this: function filter_image_send_to_editor($html, $id, $caption, $title, $align, $url, $size, $alt) { $html = sprintf(‘<a href=”#” data-rel=”lightbox-0″><img alt=”%2$s” src=”%1$s” /></a>’, esc_attr(esc_url($url)), esc_attr($title)); return … Read more

Prevent body scrolling but allow overlay scrolling

Theory Looking at current implementation of the pinterest site (it might change in the future), when you open the overlay a noscroll class is applied to the body element and overflow: hidden is set, thus body is no longer scrollable. The overlay (created on-the-fly or already inside the page and made visible via display: block, … Read more

Changing image sizes proportionally using CSS

This is a known problem with CSS resizing. Unless all images have the same proportion, you have no way to do this via CSS. The best approach would be to have a container, and resize one of the dimensions (always the same) of the images. In my example I resized the width. If the container … Read more

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