layers_before_single_content

Since: 1.0.7 Last Updated:
Back to Main Index

Outputs your custom code before the_content() ‘s wrapper and after the featured image on the single post. Even though the location is similar to layers_after_feature_media in this case, this hook modifies only the single post, rather than all instances of where a featured image appears.

Location: partials/content-single.php

Code output appears after:

Code output appears before:

Usage:

This hook can be useful if you want to insert custom code, such as buttons, links or static text, between the featured image and post content. This example uses layers_post_meta to show the date and author in this location. It assumes the date output above the title is being hidden with CSS ie .single header .meta-info{display: none;}