Get an array containing ONLY post IDs of attached images

The following code should work for you, $images = get_children( array(‘post_parent’ => $post_id, ‘post_type’ => ‘attachment’, ‘post_mime_type’ => ‘image’) ); $image_ids = array(); if($images){ foreach( $images as $imageID => $imagePost ){ array_push($image_ids, $imageID); } } The array $image_ids would get you the image IDs.

How do I display image files as links?

There’s no such “non-coding newbie”-bulk-thing for the process. You have to do that for each of the image, when you are uploading the image to the site and/or post/page. On the right panel of the media upload pane, change “Link To” to “Custom URL” and put the URL (whatever you like – internal or external) … Read more

Get the name of an image [duplicate]

I have and succeed. How to post_mime_type different? I have added the post_mime_type in functions.php add_filter(‘upload_mimes’, ‘pixelo_upload_types’); function pixelo_upload_types($existing_mimes=array()) { $existing_mimes[‘otf’] = ‘otf’; $existing_mimes[‘ttf’] = ‘ttf’; return $existing_mimes; } then I tried here and it did not work. <?php $args = array( ‘numberposts’ => -1, ‘orderby’ => ‘menu_order’, ‘order’ => ‘ASC’, ‘post_type’ => ‘attachment’, ‘post_parent’ … Read more

Images not showing after moving site

Doing a search via PHPMyAdmin did not show up any instances of the wrong URL. However, when I searched and replaced using this plugin https://wordpress.org/plugins/search-and-replace/ I found certain URLs were incorrect. Some changes could not be made with the plugin as they were serialized.

Replacing an Image gallery

Figured it out. //Remove original Gallery function remove_the_first_gallery( $output, $attr ){ $output=”<!– gallery 1 was here –>”; // Must be non-empty. return $output; } add_filter( ‘post_gallery’, ‘remove_the_first_gallery’ ); That removed all galleries on the page. But since my new gallery isn’t technically a post_gallery, it was left alone.

Where is this folder [closed]

You would need to connect to your webserver via FTP, and navigate to that folder. That folder is not accessible via the WordPress admin utilities.