FSM Custom Featured Image Caption
This plugin allows adding custom captions to the featured images of the posts. It works with both Gutenberg and the classic editor. That’s how it works: If no caption is indicated, the plugin will display the generic caption defined in the Media Library. If a caption is indicated, the plugin will display this caption instead of the generic caption defined in the Media Library. If no caption is indicated and no legend exists in the Media Library, none will be displayed (obviously). The plugin also allows to: Hide the caption, either the original from the Media Library or the custom one. Entirely hide the featured image in the public view, without having to de-attach it from the post. Configure several options to modify the styles used in the caption. Output the text of the caption anywhere in your theme using a custom function. Output the featured image with caption inside your content with a shortcode. For maintaining a semantic code, this plugin writes the caption in a label. New in version 1.21: Compatibility with Divi themes. This is an experimental feature to allow the plugin to work with Divi, as many users requested. Note that it may not work for all layouts, and that since it replaces the function divi uses to show featured images, when enabled it may potentially cause problems with older versions of Divi or if the core theme is updated. As always, it may also be necessary to add custom css to your theme to show the captions the way you want Format The caption will adopt the format specified for the element and the wp-caption-text CSS class, which is common in WordPress themes. Usage The plugin works out of the box. To start using it, all you need to do is activate it and play with the new options in your edit page. For advanced users, you will found a special settings page for fine-tuning some details. Go to Settings > FSM Custom Featured Image Caption to set up the CSS and HTML parameters: CSS for caption text: Choose one of the options to modify the class/styles that will be used in the caption container (by default is wp-caption-text). Note that you can indicate more than one class separated with spaces. Allow HTML code: Check it if you want to parse the caption text as HTML if you need the browser to parse HTML tags instead of showing them. Keep in mind that incorrect HTML code or orphan tags can break your layout. Allow shortcodes: Check it if you want to parse the shortcodes present in the caption text. Note that if the shortcode returns HTML it will not be filtered, regardless of the “allow html code” option state; also, complex shortcodes output may alter your layout. When activated, you can write the shortcode you want to use in the caption box in the usual way, i.e. : Venetian landscape [myshortcode option1="text"] Show image captions in lists: Disabled by default. Check if you want to show the caption when the featured image appears in lists, i.e. in a category page, in a widget with latest posts, etc. Note that some themes may add containers around the image (i.e. a link tag) witch can conflict with the aspect of the caption. Enable compatibility with Divi themes: Disabled by default. Allows the plugin to work with Divi. Please read the description and the FAQ sections for more info about this option Shortcode We’ve added a shortcode that allows you to put the featured image (and it’s caption) in your page. Just write [FSM_featured_image] anywhere in the content edit box of your post or page to display it. You can also select the size of the image with the parameter “size”. Note that defined image sizes may differ between WordPress themes. The defaults are these: thumbnail, medium, medium_large, large and full. By using the shortcode, the plugin will try to remove the featured image from your theme’s default position to prevent it from appearing twice. Anyway, this is as this is an experimental feature and results may fluctuate. It also will not appear in lists. Note that the usage of the shortcode is not related to the “Allow shortcodes” option in the settings page. Usage example: [FSM_featured_image size=thumb] For developers The plugin comes with two public functions that allow you to get or output the featured image caption of the current post anywhere in your template. Once the plugin is activated, use to return a string containing the text that you can assign to a variable or where you like the caption be displayed. Both functions accept parameters passed inside an array with the following keys: tag: The tag (without brackets) you want to use as a container. By default is div. If set to false, it will remove it and will return the caption text. class: The name of the class/classes you want to use for the container. Use spaces to separate them. Empty by default. style: The CSS styles to be used in the container tag. Empty by default. force_visibility: When set to true, it ignores the hide caption option defined by the post editor. Useful for displaying your caption in a different place, but showing the featured image. Default: false. allow_html: like in the settings page, if set to true, allows the browser to parse the HTML code inside the caption text, else shows it as plain text. Default: false. allow_shortcodes: again the same behaviour than in the settings page. Default: false. ignore_original_caption: stops using captions defined in the media library as a substitution when the caption field is empty. Default: false. Usage example: `php the_FSM_featured_image_caption( array(‘tag’ => ‘p’, ‘class’ => ‘class1 class2’, ‘style’ => ‘color: red;’, ‘allow_html’=> true, ‘allow_shortcodes’=>true ); In Gutenberg themes, the plugin generates a nested tag. If you need to ensure the resulting HTML code is syntactically proper, you can try using this filter in your theme functions.php file: add_filter('render_block_core/post-featured-image', 'FSMCFIC_featured_image_block_fix', 10, 2);` Translations The plugin comes up with three complete translations: English (en) Spanish (es_ES) Catalan (ca) You can contribute to translating it into more languages at https://translate.wordpress.org/projects/wp-plugins/fsm-custom-featured-image-caption/ Coming soon More options for selecting the text to be used as the caption, allowing to choose amongst image Title / Caption / Alt Text / Description and custom text. Options to fine-tune the shortcode. Have more ideas? We are open to hearing!
Top keywords
- caption32×2.91%
- image17×1.55%
- featured14×1.27%
- featured image12×1.09%
- text12×1.09%
- default11×1.00%
- html11×1.00%
- allow10×0.91%
- page8×0.73%
- shortcode8×0.73%
- want7×0.64%
- class6×0.55%
Media Library Assistant
The Media Library Assistant provides several enhancements for managing the Media Library, including: Complete support for ALL taxonomies, including the standard Categories and Tags, your custom taxonomies and the Assistant’s pre-defined Att. Categories and Att. Tags. You can add taxonomy columns to the Media/Assistant listing, filter on any taxonomy, assign terms and list the attachments for a term. The Media/Assistant admin screen displays more attachment information such as parent information, file URL and image metadata. Provides many more listing columns (more than 20) to choose from. You can also add columns to display custom field values. Provides additional view filters for MIME types and taxonomies, and features to compose custom views of your own. Inline “Bulk Edit” and “Quick Edit” areas; update author, parent and custom fields, add, remove or replace taxonomy terms for several attachments at once. Works on the Media/Add New screen as well. Works with the popular Admin Columns plugin for even more Media/Assistant screen customization. IPTC, EXIF (including GPS), XMP and PDF metadata can be assigned to standard WordPress fields, taxonomy terms and custom fields. You can update all existing attachments from the Settings page IPTC/EXIF tab, groups of existing attachments with a Bulk Action or one existing attachment from the Edit Media/Edit Single Item screen. Twelve hooks provided for complete mapping customization from your theme or plugin code. You can view and/or download this PDF document with more information: Mapping File Metadata to WordPress Fields with Media Library Assistant Attachment metadata such as file size, image dimensions and where-used information can be assigned to WordPress custom fields. You can then use the custom fields in your [mla_gallery] display and you can add custom fields as sortable, searchable columns in the Media/Assistant submenu table. You can also modify the WordPress _wp_attachment_metadata contents to suit your needs. Complete control over Post MIME Types, File Upload extensions/MIME Types and file type icon images. Fifty four (54) additional upload types, 112 file type icon images and a searchable list of over 1,500 file extension/MIME type associations. Complete control over Intermediate Image Sizes, used by WordPress to generate and access intermediate image sizes for Media Library items. The [mla_gallery] shortcode, used in a post, page or custom post type to add a gallery of images and/or other Media Library items (such as PDF documents). MLA Gallery is a superset of the WordPress [gallery] shortcode; it is compatible with [gallery] and provides many enhancements. These include: 1) full query and display support for WordPress categories, tags, custom taxonomies and custom fields, 2) support for all post_mime_type values, not just images 3) media Library items need not be “attached” to the post, and 4) control over the styles, markup and content of each gallery using Style and Markup Templates. Twenty-eight hooks are provided for complete gallery customization from your theme or plugin code. The [mla_tag_cloud] shortcode, displays a “cloud” of the “most used” terms in your Media Library where the size of each term is determined by how many times that particular term has been assigned to Media Library items. Twenty-five hooks are provided for complete cloud customization from your theme or plugin code. The [mla_term_list] shortcode, displays hierarchical (and flat) taxonomy terms in list, dropdown control or checklist formats. Twenty hooks are provided for complete list customization from your theme or plugin code. The [mla_custom_list] shortcode, displays flat/cloud lists, dropdown controls and checkbox lists of custom field values. Twenty-seven hooks are provided for complete list customization from your theme or plugin code. The [mla_archive_list] shortcode, displays flat/cloud lists and dropdown controls of date-based values. Twenty hooks are provided for complete list customization from your theme or plugin code. Powerful Content Templates, which let you compose a value from multiple data sources, mix literal text with data values, test for empty values and choose among two or more alternatives or suppress output entirely. Support for WPML and Polylang multi-language CMS plugins. MLA has earned a place on WPML’s List of Recommended Plugins. Works with Photonic Gallery, Justified Image Grid, Jetpack and other plugins, so you can add slideshows, thumbnail strips and special effects to your [mla_gallery] galleries. Works with WordPress Real Media Library: Media Library Folder & File Manager (Lite and Pro) to organize your files into folders, collections and galleries. This combination enhances both the Media/Assistant admin submenu and the [mla_gallery] shortcode. Works with CatFolders – WP Media Folders (Lite and Pro) to categorize media files better and faster. This combination enhances both the Media/Assistant admin submenu and the [mla_gallery] shortcode. Enhanced Search Media box. Search can be extended to the name/slug, ALT text and caption fields. The connector between search terms can be “and” or “or”. Search by attachment ID or Parent ID is supported, and you can search on keywords in the taxonomy terms assigned to Media Library items. Works in the Media Manager Modal Window, too. Taxonomy and custom field support in the ATTACHMENT DETAILS pane of the Media Manager Modal Window and Media/Library Grid view. The Assistant is designed to work like the standard Media Library pages, so the learning curve is short and gentle. Contextual help is provided on every new screen to highlight new features. NOTE: Complete documentation is included in the Documentation tab on the Settings/Media Library Assistant admin screen and the drop-down “Help” content in the admin screens. You can find a stand-alone version of the Documentation on my web site: Media Library Assistant Documentation I do not solicit nor accept personal donations in support of the plugin. WordPress and its global community means a lot to me and I am happy to give something back. If you find the Media Library Assistant plugin useful and would like to support a great cause, consider a tax-deductible donation to our Chateau Seaview Fund at the ALS Network. Every dollar of the fund goes to make the lives of people with ALS, their families and caregivers easier. Thank you! Acknowledgements Media Library Assistant includes many images drawn (with permission) from the Crystal Project Icons, created by Everaldo Coelho, founder of Yellowicon. Many thanks to Aurovrata Venet, Il’ya Karastel and Kristian Adolfsson for testing and advising on the multilingual support features! The Example Plugins The MLA example plugins have been developed to illustrate practical applications that use the hooks MLA provides to enhance the admin-mode screens and front-end content produced by the MLA shortcodes. Most of the examples are drawn from topics in the MLA Support Forum. The Documentation/Example Plugins submenu lets you browse the list of MLA example plugins, install or update them in the Plugins/Installed Plugins area and see which examples you have already installed. To activate, deactivate or delete the plugins you must go to the Plugins/Installed Plugins admin submenu. The Example plugins submenu lists all of the MLA example plugins and identifies those already in the Installed Plugins area. In the submenu: the “Screen Options” dropdown area lets you choose which columns to display and how many items appear on each page the “Help” dropdown area gives you a brief explanation of the submenu content and functions the “Search Plugins” text box lets you filter the display to items containing one or more keywords or phrases bulk and rollover actions are provided to install or update example plugins the table can be sorted by any of the displayed columns Once you have installed an example plugin you can use the WordPress Plugins/Editor submenu to view the source code and (with extreme caution) make small changes to the code. Be very careful if you choose to modify the code! Making changes to active plugins is not recommended. If your changes cause a fatal error, the plugin will be automatically deactivated. It is much safer to download the file(s) or use FTP access to your site to modify the code offline in a more robust HTML/PHP editor. You can use the “Download” rollover action to download a plugin to your local system. Once you have made your modifications you can copy the plugin to a compressed file (ZIP archive) and then upload it to your server with the Plugins/Add New (Upload Plugin) admin submenu. If you do make changes to the example plugin code the best practice is to save the modified file(s) under a different name, so your changes won’t be lost in a future update. If you want to retain the file name, consider changing the version number, e.g. adding 100 to the MLA value, so you can more easily identify the plugins you have modified.