layers_before_feature_media

Since: 1.0 Last Updated:
Back to Main Index

Outputs your custom code before an instance of a post featured image displayed using the layers_post_featured_media()  tag.

Location: core/helpers/template.php

Code output appears before:

Usage:

Example:

This hook is useful for inserting code before the featured image or video, assuming layers_post_featured_media() is used to output the image or video, such as a wrapper tag with a custom class, or a more complex code block such as a Pin-It button or likes counter. It can be used in combination with conditional statements to ensure your code only appears before featured images in single posts, or a custom post type in your extension.

In combination with layers_after_featured_media :