Articles of images

2 image size for post

I have servel image sizes in my post, all under 2 proportion: square and rectangle. for example square :100X100, 200X200 rectangle: 300X100, 600X200 Via ACF I created new image upload file so I can upload one proportion via ACF and one proportion via ‘post-thumbnails’ How can I control add_image_size function so the rectangle resize will […]

Show image crop window on image upload

I’m trying to add image from front end and crop it after upload. Used setState( ‘cropper’ ); to enable image crop window. It open the image upload window. Upload an image. But, Not open Image Crop window. Reference from Add Shortcode: [frontend-image-upload] function frontend_image_upload() { wp_enqueue_media(); wp_enqueue_script( ‘media-grid’ ); wp_enqueue_script( ‘media’ ); wp_enqueue_script( ‘frontend-image-upload’, […]

Cropping an image before inserting into a post

I’ve got a frontend post form, and I’ve been using this PHP code to allow uploading an image and to insert it into a post. // image upload and attatching to post if ( ! empty( $_FILES ) && ! empty( $_FILES[‘upload-image’][‘name’] ) ) { // upload image to server $upload = wp_upload_bits( $_FILES[‘upload-image’][‘name’], null, […]

Accessing an image folder inside public web directory

I have put a folder in the public web directory of my WordPress installation where I have some images used by a legacy system. Say its located under I have changed the rights on that folder to 0444 so it should be readable. For some reason, I can’t access the images in that folder. […]

Problem: wp_query outputs all images on site

I’m having issues with a query. I want to get the images attached to an individual post of the type rental. My query is broken as it outputs all the images on the entire site: $image_query = new WP_Query( array( ‘post_type’ => ‘attachment’, ‘post_status’ => ‘inherit’, ‘post_mime_type’ => ‘image’, ‘posts_per_page’ => -1, ‘post_parent’ => $rental->post->ID, […]

Images stopped loadding after adding SSl

I have transferred my blog to a new host where i added an SSl , and i have made some changes: Changed all links inside the DB backup file from http to https for all internal links, then import. and edited the WP_HOME and WP_SITEURL inside the wp-config to match https. Tried to add define(‘FORCE_SSL_ADMIN’, […]

Why it doesn't show media urls on rest Api? (WordPress)

Im using Listable theme on my website and Rest Api because im developing the Android App. I need to show on the rest api the url links of my listings but they doesn’t show. For example here: It just says “main_image”:[“12382,12383,12384”] … A strange thing is that when a user request to add their […]

Include image in excerpt

I’m using WP Rest API to retrieve post information to display on another system. One of the things I’m retrieving is the excerpts of the posts. I’d like to include images in the excerpt retrieved. How would you suggest this is done? I’m assuming WordPress strips out elements within tags such as <img>. Could it […]

Empty alt/title form check in media library

Many times, staff members of my site, are forgetting to alt/title tags once they upload images to the wp library. Could you guys help me to figure out how to check and alert in case those forms are empty? I found this script by brasofilo but it’s from 2012 and looks like it is not […]

Importing images results to wrong folder structure

I imported ~10GB of images from my old site to the new server. Most things work fine, but on appr. 5%, the image is uploaded to a wrong folder. I.e. the page refers to “uploads/2017/03/test.jpg” but the file is saved in “uploads/2017/02/test.jpg”. There is no real logic behind this, sometimes the folder is a […]