How do I remove images from all posts?

I have many posts on my news site, I have a space issue, I would like for posts older than three months, to remove the images that are in the post, but keep the featured images and the post itself. Please help, I have no idea how to do this.
Category: Web

WordPress PNG compression issue

I'm having issues with images getting badly compressed when uploaded to my site. It's not an issue with photographs, but is very noticeable for images with solid blocks of colour and text. I've uploaded a PNG with a solid grey background overlaid with white text, and it's being badly compressed when WordPress resizes it to the various alternative sizes. Original image Large featured image size Unfortunately I don't have enough reputation to post more than 2 links, but you can …
Category: Web

How To Retrieve An Image Attachment's Alt Text?

I am using an attachment.php file to show large versions of images that have been clicked on elsewhere. I'd like to pull the image alt text as a caption under the image with javascript, but the alt text isn't included when when wp_get_attachment_image_src() is used. I don't think WP has a function to retrieve it, so I need my own. To write that function I need to know...Where is the alt text for an image stored? My attachment page uses …
Category: Web

Display alt text as tool tip on page

I'm using the Background Manager Wordpress plugin (http://wordpress.org/plugins/background-manager/) and I'm trying to display a custom element on the page that I have not been able to find any help on as of yet, including with their forums. The plugin outputs a full-screen background, which includes alt text, and I'm wondering if there's a way I can display the alt text on the page in a DIV? The code that displays on the page currently is: <!-- Background Manager Start --> …
Category: Web

Bulk-add featured images in posts with no featured image

I have a site with loads of posts (news items). Some posts don't have featured images yet. Adding the images to those posts (few hundreds) is a tedious task. We basically want to add 1 and the same image to all the posts without a featured image. Is there a way to do this in bulk? Like ADD 'this image' to ALL 'posts' (not pages) WHERE 'featured_image' is empty. I really hope there's a plugin for that. Can't find it …
Category: Web

Background image not appearing

I'm trying to add a custom background on a child theme. In the child theme's functions.php, I add add_theme_support( 'custom-background'); and the background option appears under the "Appearance" menu as expected. I add the image that I want, save, and nothing happens. The image won't appear as the background. What am I doing wrong? Using version 4.3.1. This is all that's in my child theme's function.php" <?php add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' ); function theme_enqueue_styles() { wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); …
Category: Web

Omit image captions from get_the_content()

I use a theme that calls get_the_content() to display short excerpts of the latest blog posts on the home page. Now I noticed that the excerpt sometimes starts with an image caption, if the blog post contains a picture at the very beginning. I usually do that and make the text float around it. I always set the first three caption fields on an image (Alt Text, Title, Caption). Is there any way to strip these image captions from the …
Category: Web

Media Library is not loading on grid view in admin panel

Media Library is not loading on grid view and also featured image not select any image from post and page . The progress circle keeps spinning. Due to this issue, I am not able to add any image in the post as insert image option also opens in “grid view” by default. The things I tried but not resolved my issue: Removed all plugins. Switch to twenty sixteen theme. Deleted whole wordpress installation. Installed fresh. Enabled script debug.Doesn’t show any …
Category: Web

alt, title tags not showing

I have added alt tags, title and description on all the images on my website but none are showing when I check them in the inspect element tool in chrome or firefox. Here's a screenshot: And here's the screenshot of inspect element of the same image:
Category: Web

How do I return an image from a script

I have googled but must not be using the correct terms. I am trying to add a script to my WordPress plugin that takes a url and returns a reformatted image. I know this is frowned upon as hotlinking. The image in my case is supplied by a website imaging service. The image takes from 3 to 5 seconds to be generated. I have a java script that sets my preview image src tag once the website url is entered …
Category: Web

Show media-frame-menu on custom Media Frame

I have a plugin I built that adds a custom media frame with the following: media_frame = wp.media.frames.media_frame = wp.media({ title: 'Select your images', button: { text: 'Use Image' }, multiple: false }); media_frame.open(); This produces a media frame that looks like this: Thus far, this has been all I needed, but my site uses Wordpress Multisite and I'm trying to add in the Network Shared Media plugin. However, Network Shared Media requires the media-frame-menu sidebar in order to access …
Category: Web

How to use thumbnail size of image if I'm only using src to get image

I have a custom field for an image, and using it this way: <?php $item_img = get_sub_field('image'); ?> <img src="<?php echo $item_img ?>" /> But I want to use the thumbnail version of the image, as set to 150x150 in wordpress. How do I do that with this type of setup? Do I have to set a custom add_image_size() or does wordpress have duplicated thumbmail size images?
Category: Web

How to get rid of undefined variable in previous post image

I am working on a website on WordPress and I have it set to where the bottom of the post will automatically link to a random previous post with a picture from that previous link but a notice keeps popping up on the bottom. It says there is something wrong with the previous post image url but the website sets this automatically and it works for all my other posts. Since it is undefined should I try to define it …
Category: Web

WordPress 404 Images - Images not found after deleted from media

I am trying to develop the website to find images that have been deleted from the media library as they were not needed. These Images that I have deleted have previously been on pages but have been replaced on the page now... but if you go to https://tools.pingdom.com/#!/ctzBfY/http://waggypetservices.co.uk you can see that some of the deleted images are still being called... this call also be seen in the page source. My question is how can I find what is calling …
Category: Web

Migration to WP - Couldn't load image

Situation: I'm trying to migrate static page made with HTML/CSS/JS into Wordpress. The images won't load. They work in HTML, but when I migrate into PHP there are only alt-descriptions visible. Upon examining it in the Mozilla Dev Tools, there is a correct link to the image that displays the image upon clicking. However, on the migrated WP site there's an error "Couldn't load image". Directory seems correct, but image just won't load. What I tried. get_theme_file_uri() <img src="<?php echo …
Category: Web

List all images from a single post meta value

I have created a custom post type with an image gallery upload. Now I am trying to display the gallery on the front end. This is what I have so far that works to display 1 image, but if multiple images are uploaded all the URLs get stuck in the src tag. So I'm guessing I should loop through that array and spit out each one separately? Would that be the route to go and if so how can I …
Category: Web

Why can I not view image attachment pages?

I have a problem with images. I can see my uploaded images, as previously, through the media library. I can access each image by clicking on "edit". But if I then click on "View Attachment Page", I am taken to the "404! We couldn't find the page!" message. This applies to all images in the library. At the same, images in some posts (but not all) are behaving differently from before. It used to be possible for readers to click …
Category: Web

Embed image in post from external url

Is there a way in Wordpress that I can embed an image to a post when I want to include it like this: <img src="....." /> So I want to add this manually. Is this possible? Now, I get the URL, without the image. So the embedding process isn't done. PS: I am using a front-end editor.
Category: Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.