• I am very pleased with this plugin.

    I would like the image alt attribute to be included automatically.

    Would also good if the image caption field could be included.

    How can I add this functionality?

Viewing 1 replies (of 1 total)
  • Plugin Author Paul Menard

    (@pmenard)

    Steve,

    Thanks for using my plugin. The caption is not include by default on purpose. Many people who use the plugin display groups of thumbnails in a grid. By including the caption below the images the grid would break.

    You can easily add your own formatting to the image items. This does require some PHP knowledge and not something you can turn on via a settings option. Basically, you need to override the default callback function. This callback function is used when you use Media-tags via the shortcodes call [mediatags]. See the Media-Tags documentation for details on the shortcode use.

    As part of the shortcode parameters look for the item ‘display_item_callback’. This parameter lets you specify your own function to be called for each image.

    Now look at the files in the Media-Tags plugin folder. Look for the file named ‘mediatags_shortcodes.php’. Open this file in an editor. Toward the bottom of this file is a function ‘mediatags_item_callback_with_caption’ which is an example of including the caption as part of the image display.

    You should copy this entire function to your ow theme folder and rename it to something unique. Then adjust the code to your liking.

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Media Tags] how to alt and caption to images’ is closed to new replies.