This plugin extends the core/cover block with separate mobile and desktop background images and sizes. This increases the performance of the website by loading the smaller image on mobile devices and scores better in the Core Web Vitals.
- In the Settings > Mosne Hero page you can configure the mobile image size and the breakpoint at which the mobile image is displayed
- Note that this is a new size, so you will need to regenerate the thumbnails using a plugin like Regenerate Thumbnails for existing images to use the new sizes.
- Add a cover block and select the "Hero Cover (Mobile & Desktop)" variation.
- Now you can see a new panel with the following options:
- Mobile image : You can also select a custom image for the desktop and the mobile view.
- Mobile image size : choose the size that perfectly fits your design.
- Focal point : You can also select a focal point for the mobile image.
- Alt text : Add alternative text for the mobile image. (Leave empty if it is a decorative image)
- High fetch priority : force the high fetch priority attribute if the image is above the fold.
- If you use a featured image, leave the mobile image empty and the plugin will use the mobile size for the featured image for the mobile view.
- Separate mobile and desktop background images and sizes
- Configure the mobile image size and the breakpoint at which the mobile image is displayed
- It also works with the featured image
- Focal point switching for the mobile image
- Alt text switching for the mobile image
- High fetch priority for the mobile image
- Performance-optimized and lightweight
- The mobile image is not displayed in the block editor
- Video background is not supported
- Repeated background is not supported
- Parallax background is not supported
- You have a couple of options:
- Go to Plugins → Add New and search for "Hero". Once found, click "Install".
- Download the Hero from wordpress.org and make sure the folder is zipped. Then upload via Plugins → Add New → Upload.
- Activate the plugin through the 'Plugins' screen in WordPress.
- Search for the "Hero" block within the Block Editor (Gutenberg) and add it to your page.
You can configure the plugin in the settings page.
You can use the following hooks to configure the plugin:
add_filter( 'mosne_hero_enable_image_size', '__return_false' );
add_filter( 'mosne_hero_mobile_width', 'your_function' );
add_filter( 'mosne_hero_mobile_retina_width', 'your_function' );
add_filter( 'mosne_hero_mobile_height', 'your_function' );
add_filter( 'mosne_hero_mobile_retina_height', 'your_function' );
add_filter( 'mosne_hero_crop', 'your_function' );
add_filter( 'mosne_hero_breakpoint', 'your_function' );
add_filter( 'mosne_hero_settings', 'your_function' );- This will disable the image size registration.
- This will return the mobile width and the mobile retina width.
- This will return the mobile height and the mobile retina height.
- This will return the crop option.




