WordPress Gallery Thumbnail images look blurry

luckily I found the answer shortly after posting this question. My thumbnail size setting (Settings/Media) was 150 x 150px – cropped. So when I displayed them on my page, desktop size, in a row of 4, the thumbnails were getting stretched to 282 x 282px. I changed it to this new size and used a … Read more

Get gallery images from page ID

You could use the get_post_galleries_images function, which returns an array of all the galleries from whatever post ID you specify. The following is a quick function that will display all the images: function na_get_gallery_image_urls( $post_id, $number = false ) { $post = get_post($post_id); $count = 0; // Make sure the post has a gallery in … Read more

Optimizing wp_get_attachment_image_src

Usually for gallery post types with lots of attachments, you would do it like this: http://codex.wordpress.org/Template_Tags/get_posts#Show_attachments_for_the_current_post Inside a “WordPress Loop”: <?php $args = array( ‘post_type’ => ‘attachment’, ‘numberposts’ => -1, ‘post_status’ => null, ‘post_parent’ => $post->ID ); $attachments = get_posts($args); if ($attachments) { foreach ( $attachments as $attachment ) { echo apply_filters( ‘the_title’ , $attachment->post_title … Read more

Gallery Shortcode Showing IDs

Remove: $content = get_the_content(); and replace: <p><?php echo $content; ?></p> with: <?php the_content(); ?> See this note on the Codex page for get_the_content(): An important difference from the_content() is that get_the_content() does not pass the content through the ‘the_content’ filters. This means that get_the_content() will not auto-embed videos or expand shortcodes, among other things.

How to make gallery images responsive?

In order for your images to be responsive they require CSS. The CSS will inform the image to stretch 100% of the available space and to automatically adjust the height. img.responsive { width: 100%; height: auto; } Because you don’t want to apply this rule to all images, you’ll need to add a class on … Read more

Gallery backend only

I used to rely on image gallery plugins, like PhotoQ -which no longer exists- or NextGen. For one, a plugin may die and leave a migration problem, or it may be well maintained but require too much of custom coding. Nowadays I try to keep it within WordPress attachment post type. A plugin may handle … Read more

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