Insert content around posts
Use Settings → POM Tweaks → Content → Post content hooks to add reusable HTML or registered shortcodes without editing individual posts. This site-level control is intended for administrators who manage notices, calls to action or reusable content around posts.
Configure the positions
- Enable Post content hooks and save.
- Enter safe HTML or a registered shortcode in the required position. Leave unused positions empty.
- Save and open a published post on the frontend.
- Check each configured position and compare a page or a custom post type to confirm the expected scope.
| Field | Where it appears |
|---|---|
| Before post content | Immediately before the rendered content of the post type. |
| After post content | Immediately after the rendered content of the post type. |
| Before post single content | POM Theme's position before its single-post content area. |
| After post single content | POM Theme's position after its single-post content area. |
| After post single footer | After the POM Theme single-post footer. |
| After post single author | After the POM Theme author area. |
| After post single navigation | After the POM Theme previous/next navigation area. |
| After post single comments | After the comments area when POM Theme displays it. |
For example, enter <div class="post-notice">Contact us for more information.</div> before the content, or use a shortcode already provided by your theme or plugins. HTML is cleaned to remove executable scripts; PHP is not executed. Shortcode output follows the shortcode provider's own behavior. Fields left empty produce no addition.
Understand the rendering scope
The first two positions apply when the frontend renders full post content in the main WordPress loop. That includes primary archive lists and feeds that render full content. They do not add text to excerpts, pages, other post types, secondary loops, navigation fragments or standalone API rendering. A custom template that bypasses the content filter does not use these positions.
The six other positions require POM Theme or a POM child theme, and the matching single-post template hook must actually run. They follow the template's scope, including any custom types using that template. A disabled content area or comments area can prevent its corresponding hook from running. Configuration remains saved when switching themes and becomes effective again when the appropriate POM template is used.
Password-protected content does not receive additions until its password requirement is satisfied. These settings do not alter stored post content, permissions or publication state. They are frontend additions and do not appear in the post editor.
Verify and troubleshoot
- Reload the settings page after saving and check that the HTML is still present.
- Open a post and confirm the content appears once at each configured position. If a template renders a post more than once, each render can include the addition.
- If content appears twice around the same area, check whether both a normal content position and the corresponding POM position are configured.
- If a theme position is missing, confirm the active theme and that the relevant area is enabled in its layout. The comments hook requires a rendered comments area.
- If a shortcode remains as text, confirm its provider is active and the shortcode name is correct. Recursive shortcode rendering is stopped to avoid repeatedly inserting these fragments.
- After changing or disabling the module, refresh any page caches to see the current output.
To reverse the change, clear individual fields or disable Post content hooks and save. Existing posts remain unchanged; saved fragments are retained when the module is disabled.
Theme integration reference
The theme positions use the existing actions pom_before_post_single_content, pom_after_post_single_content, pom_after_post_single_footer, pom_after_post_single_author, pom_after_post_single_nav and pom_after_post_single_comments. They are insertion points supplied by POM Theme; this module does not register new shortcodes.