How to extract images of post and pages excluding header and logo image in wordpress?

I believe this will get you all of your attachments: $q = new WP_Query( array( ‘post_type’=>’attachment’, ‘post_status’=>’inherit’ ) ); var_dump($q); You could further restrict that by adding other parameters, for example, ‘post_mime_type’ => ‘image’ would restrict only to images. That will return all images though, not just the ones attached to posts. What you want … Read more

Adjusting caption below single post image

Override The Image Caption With Image Title And Description Here’s a way to override the caption with the image title and image description, with a demo plugin. Let’s assume we have uploaded this image: Then we insert it into the editor with the following: Before: Without our plugin activated it will display as: After: With … Read more

Get post embedded image caption

If I understood correctly, you are trying to add, to every image embedded in a post gallery, a custom rel attribute and a title attribute based on the attachment caption. Instead of parsing the content, you can try to modify the anchor that wraps the images using the ‘wp_get_attachment_link’ filter. <?php function wpse221533_add_caption_title_to_content_gallery_image_attachments( $markup, $id, … Read more

Add visual editor to Media Edit Screen

This function added to functions.php does exactly that: // Enables Editor in Media edit screen. function add_editor_support_for_attachments($settings) { if( get_post_type() == ‘attachment’){ $quicktags_settings = array( ‘buttons’ => ‘strong,em,link,block,del,ins,ul,ol,li,code,close’ ); $settings = array( ‘wpautop’ => true, ‘textarea_name’ => ‘content’, ‘textarea_rows’ => 10, ‘media_buttons’ => false, ‘tinymce’ => true, ‘quicktags’ => $quicktags_settings, ); return $settings; } } … Read more