how automatically show the image title before the image caption/description in a wordpress gallery?

use this code in single.php $post->ID, ‘post_type’ => ‘attachment’, ‘numberposts’ => -1, ‘orderby’ => ‘title’, ‘order’ => ‘ASC’, ‘post_mime_type’ => ‘image’, ))) { foreach( $images as $image ) { $attachmenturl = wp_get_attachment_url($image->ID); $attachmentimage = wp_get_attachment_image_src( $image->ID, full ); $imageDescription = apply_filters( ‘the_description’ , $image->post_content ); $imageTitle = apply_filters( ‘the_title’ , $image->post_title ); $i++; if (!empty($imageTitle)) … Read more

Customise the WordPress gallery html layout

I find a solution for this: // Customise the WordPress gallery html layout add_filter(‘post_gallery’,’customFormatGallery’,10,2); function customFormatGallery($string,$attr){ $output = “<div class=\”mihan-gallery\”>”; $posts = get_posts(array(‘include’ => $attr[‘ids’],’post_type’ => ‘attachment’)); foreach($posts as $imagePost){ $output .= “<a class=\”mihangitem\” href=”https://wordpress.stackexchange.com/questions/384853/”.wp_get_attachment_image_src($imagePost->ID,”mihan-large’)[0].”‘><img src=”https://wordpress.stackexchange.com/questions/384853/”.wp_get_attachment_image_src($imagePost->ID,”mihan-medium’)[0].”‘></a>”; } $output .= “<div class=\”clear\”></div></div>”; return $output; }

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