== Featured Background ==
Contributors: Schwarttzy
Tags: background, featured image, custom background, page background, post background, parallax, overlay, gutenberg
Requires at least: 6.0
Tested up to: 6.8.2
Stable tag: 1.0
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Set a featured image as the background for individual posts or pages with advanced options like parallax, overlays, and more.

== Description ==

**Featured Background** is a lightweight WordPress plugin that lets you set a custom background image for specific posts or pages using the built-in featured image functionality. Now enhanced with expanded options for customization, parallax effects via CSS, overlay colors, custom post type support, Gutenberg sidebar integration, and UI improvements.

= Key Features =
- **Expanded Background Options**: Customize position, repeat, size, attachment, and fallback color.
- **Parallax Effect**: Simple CSS-based parallax (using fixed attachment) with an optional toggle.
- **Overlay Color and Opacity**: Add a semi-transparent overlay for better text readability.
- **Custom Post Type Support**: Enable the meta box on any public CPT via a settings page.
- **Gutenberg Integration**: Dedicated plugin sidebar in the block editor for seamless configuration.
- **UI Improvements**: Added "Remove Image" button and live preview in the meta box.
- **Simple Integration**: Easily upload or select an image via the WordPress media library.
- **Automatic CSS Injection**: Injects inline CSS into the header with options applied to the `body` element.
- **Admin Preview**: Live preview in the editor.
- **Secure and Efficient**: Nonces, sanitization, conditional enqueuing.
- **Clean Uninstall**: Removes all data on deletion.
- **Modern Compatibility**: Tested with WordPress 6.8.2 and PHP 8+.

Ideal for personalizing backgrounds per page. The CSS includes comments for identification.

Report issues on the [support forum](https://wordpress.org/support/plugin/featured-background/).

== Installation ==

= Minimum Requirements =
- WordPress 6.0 or higher
- PHP 7.4 or higher

= Automatic Installation =
1. Go to your WordPress dashboard: Plugins > Add New.
2. Search for "Featured Background".
3. Click "Install Now" and then "Activate".

= Manual Installation =
1. Download the plugin ZIP file from the WordPress.org plugin directory.
2. In your WordPress dashboard, go to Plugins > Add New > Upload Plugin.
3. Upload the ZIP file and click "Install Now".
4. Activate the plugin.

After activation:
1. Go to Settings > Featured Background to select supported post types.
2. Edit a supported post or page.
3. Use the "Featured Background" meta box or Gutenberg sidebar to set options.
4. Save or update the post/page—the background will apply automatically on the front end.

If permalinks or caching issues arise, flush your site's cache and regenerate permalinks via Settings > Permalinks.

== Frequently Asked Questions ==

= Why isn't the background showing? =
Check image selection, save the post, and theme conflicts—some themes may override body backgrounds with their own CSS. Clear your browser cache and test with a default theme like Twenty Twenty-Four.

= How do I enable on custom post types? =
Go to Settings > Featured Background and select them from the list of public post types.

= Does this work with Gutenberg? =
Yes, via a dedicated sidebar panel in the block editor.

= How does the parallax work? =
It's a simple CSS effect using `background-attachment: fixed` when toggled on.

= Can I adjust the overlay? =
Yes, choose the color and opacity (0-1) directly in the editor.

= How do I remove the image? =
Use the "Remove Image" button in the meta box or Gutenberg sidebar.

= Does the plugin collect data? =
No, it doesn't track usage or collect personal data. All settings are stored locally in your database as post meta.

For more questions, check the [support forum](https://wordpress.org/support/plugin/featured-background/).

== Screenshots ==

1. The enhanced "Featured Background" meta box with options.
2. Gutenberg sidebar integration.
3. Settings page for CPT support.
4. Front-end example with overlay and parallax.

== Changelog ==

= 1.0 =
* Released: September 04, 2025
* Added expanded background options (position, repeat, size, attachment, fallback color).
* Implemented simple CSS parallax (fixed attachment toggle).
* Added custom post type support via settings page.
* Added overlay color and opacity.
* Integrated Gutenberg plugin sidebar.
* Added "Remove Image" button and UI improvements.
* Updated JS for color pickers and Gutenberg.
* Bumped version and tested up to 6.8.2.
* Enhanced uninstall to cover new meta.\
* Major overhaul for modern compatibility.

== Upgrade Notice ==

= 1.0 =
Major feature additions including parallax, overlays, CPT support, and Gutenberg integration. Back up your site before upgrading. Test on a staging site if possible.