EasyWP Mobile Featured Image

Version: 2.0.0 Requires WordPress: 5.0+ Requires PHP: 7.0+ License: GPLv2 or later

Description

EasyWP Mobile Featured Image is a mobile-optimized WordPress plugin that solves the inconsistency between desktop and mobile featured image display. It allows administrators to set separate featured images for mobile devices, enhancing the browsing experience for mobile users.

Core Features

Easy Admin Setup

Adds a "Mobile Featured Image" meta box to the sidebar of post/page edit screens – supports upload, preview, and removal.

Automatic Mobile Replacement

Detects mobile visits via wp_is_mobile() – replaces thumbnail IDs, metadata, HTML output, and post list images.

REST API Support

Automatically returns mobile featured image data for mobile API requests – compatible with headless WordPress setups.

Shortcode & Template Functions

Flexible extension for developers – shortcode with custom parameters and 4 template helper functions.

Full Compatibility

Works with all public post types (posts, pages, custom post types) – no extra configuration needed.

Installation Guide

  1. Download the plugin zip file.
  2. Log in to your WordPress admin dashboard, go to "Plugins" → "Add New" → "Upload Plugin", upload the zip file.
  3. Click "Activate Plugin" to complete installation.
  4. Navigate to any post/page edit screen – find the "Mobile Featured Image" meta box in the sidebar.

How to Use

I. Admin Operation (Set Mobile Featured Image)

  1. Edit any post or page, locate the "Mobile Featured Image" meta box in the sidebar.
  2. Click "Select Image" to choose/upload a mobile-optimized image from the media library.
  3. The image will preview automatically – click "Remove Image" to replace or delete it.
  4. Save the post/page – mobile visitors will see the dedicated mobile image automatically.

II. For Theme Developers

Shortcode Usage

Basic usage: [mobile_featured_image]

Custom usage: [mobile_featured_image id="123" size="medium" class="custom-class" alt="Custom alt text"]

Template Functions

  • has_mobile_featured_image( $post_id ) – Checks if a post has a mobile featured image
  • the_mobile_featured_image( $size, $attr ) – Outputs the mobile featured image (falls back to default)
  • get_mobile_featured_image_url( $post_id, $size ) – Retrieves the image URL
  • get_mobile_featured_image_id( $post_id ) – Retrieves the image ID

Frequently Asked Questions

Why isn't my mobile featured image showing on mobile devices?
Please check: 1. The post/page has been saved; 2. You're accessing from a mobile device (use phone or browser mobile simulation mode); 3. A mobile featured image has been set (default will show if not set).
Can I set mobile featured images for custom post types?
Yes, the plugin supports all public post types by default – no extra configuration needed.
Can I customize the image size?
Yes, both shortcodes and template functions support WordPress built-in sizes (thumbnail/medium/large/full) or custom image sizes.

Changelog

v2.0.0

  • Enhanced REST API compatibility
  • Improved mobile image replacement logic
  • Added lazy loading support for shortcode
  • Optimized admin interface responsiveness

v1.0

  • Initial release
  • Implemented mobile featured image setup and saving
  • Automatic mobile detection and image replacement
  • Added shortcode and 4 template helper functions