Mobile Featured Image Bug

The images not being loaded are prefixed with the domain https://i2.wp.com This is the CDN used when you activate the PHOTON module in the Jetpack Plugin. If you deactivate the PHOTON module or deactivate the Jetpack Plugin, you should be rid of the issue.

How to move image thumbnails into custom folder for custom post type

Use bellow filter in the functions.php <?php add_filter( ‘upload_dir’, function($args) { if( !isset($_REQUEST[‘post_id’]) ) { return $args; } $post_type_name = get_post_type( $_REQUEST[‘post_id’] ); if( $post_type_name=”custom_post_type” ) { // Set the new path depends on current post_type $newdir=”https://wordpress.stackexchange.com/” . $post_type_name; $args[‘path’] = str_replace( $args[‘subdir’], ”, $args[‘path’] ); //remove default subdir $args[‘url’] = str_replace( $args[‘subdir’], ”, $args[‘url’] … Read more

Watermark images only for some users

I figured out a sort of working solution, by using the plugin Image Watermark by dfactory. The plugin has an option to back up all uploads, and by checking that in settings it uploads all your photos twice, with a backup in /wp-content/uploads/iw-backup/. What I did was enabling watermarking for all versions of the uploaded … Read more

Any specific reason why images do not show on site?

It seems to me that the URL is wrong for the images (HREF). Most like you are modifing or adding content to the site directly from the server while accessing it from http://localhost/. Based on your screenshot, the error message you’re getting on the workstation refers to “localhost/wordpress/content/uploads….” where localhost is the server, BUT in … Read more

Images not showing after changing wp-content folder name

The safe way to change wp-content folder, is the following: First, define the new wp-content name in your wp-config.php file: define (‘WP_CONTENT_FOLDERNAME’, ‘hamza’); Then, define the new path for images, style, scripts, etc: define (‘WP_CONTENT_DIR’, ABSPATH . WP_CONTENT_FOLDERNAME) ; define(‘WP_CONTENT_URL’, WP_SITEURL . WP_CONTENT_FOLDERNAME); This will allow your plugins and other stuff to be notified about … Read more

Adding different backgrounds for different pages

It would be helpful if you’ve said your CSS selector is whether not working or it’s working but the image just doesn’t appear. You also didn’t clarify if your image should appear literally behind the entire page (header, content and footer) or just behind the content. Anyway, Enfold adds a background-color property to almost every … Read more

Comma separated all attached image ID numbers except featured image ID number

If we want to exclude the featured post image then here’s the one-liner updated: $ids = join( ‘,’, wp_filter_object_list( get_attached_media(‘image’ ), [ ‘ID’ => get_post_thumbnail_id() ], ‘NOT’, ‘ID’ ) ); here it’s expanded: $ids = join( ‘,’, // join array by comma wp_filter_object_list( get_attached_media(‘image’ ), // fetch attached images [ ‘ID’ => get_post_thumbnail_id() ], // … Read more