Yes, there is ‘the_content’ filter. See the codex.
For instance:
add_filter( 'the_content', 'my_the_content_filter', 20 );
/**
* Add a test to the end of every post page.
*/
function my_the_content_filter( $content ) {
if ( is_singular('hotels') ){
//If a single post is being viewed, add something
//Or get the value of a custom field and append it
$post_id = get_the_ID();
$custom_field_value = get_post_meta($post_id, 'Address', true);
$content .= $custom_field_value;
}
// Make sure you returns the content, edited or otherwise
return $content;
}
Related Posts:
- Displaying Meta Box Image
- List of users that clicked a ‘Join’ button at single post
- hide specific div on single.php [closed]
- How to show custom field on specific custom post type posts only when filled
- Conditional for single-{post-type}.php
- Do_Shortcode not working for Embed
- Display custom post type and custom fields within a Bootstrap Carousel
- how to filter by last name for custom post
- Search that will look in custom field, post title and post content
- clients list using wordpress
- How to do a custom bookmarks post type?
- How do I add media to a custom post type?
- Using previous_post_link and next_post_link to wrap around post sequence
- How do I create new content pages for my Custom Post Type?
- Using new WP_Query in shortcode in a custom field causes the main post content to not display
- Using ‘strtotime’ function to convert a custom-meta-box to a date-stamp
- add_meta_box: Datepicker like the one for postdate?
- Custom field losing p tags on display
- Using posts and postmeta table to store custom Address Book Plugin data
- Bulk edit custom excerpt text in WordPress
- Formatting custom meta box date from YYYY/MM/DD to a more readable alternative
- Getting a “Changes you made will be lost” dialog prompt on a custom post type page
- Search Custom Post Type Custom Fields
- Saving repeated option values in a custom query
- Query Custom Post Types by date (custom field) range
- How to remove slug metabox from custom post type’s page?
- Custom fields in Permalinks?
- query posts and custom post type with meta key
- Dynamically add / duplicate custom meta in custom post types
- Problem fields custom date, time, and checkbox
- Custom post template for particular posts
- Custom Post type and Custom Field WP_Query
- Single Template that can be applied only via URL
- Adding Show Less/More link to Custom Post Meta
- What is the recommended / best way to do this: Event calendar post/type in a block-based theme?
- WordPress Custom Fields Won’t Save
- Found 2 elements with non-unique id (#_ajax_nonce) and (#_wpnonce)
- Store CPT ‘Reviews’ average ratings to a WordPress DB table or to a DB custom table?
- Meta Query Not Returning Output Despite Having Matching Values
- Programmatically rewriting slug through functions.php but returns 404
- Repeatable Fields Metabox with Textarea (or wp_editor)
- How to use TinyMCE Editor for one of my custom post meta field?
- How to display products name in a non-alphabetical order, in a custom field (taxonomy)?
- Displaying custom field according to date
- filter search custom field query
- How to add multiple markers on the google map, at a certain meta_key and meta_value
- Warning: Invalid argument supplied for foreach() [closed]
- Add additional field to custom post_type
- Get term name without a foreach loop
- Sorting posts by custom field value in array
- Custom Taxonomy Search result page
- Get post content from another section in custom single page
- Modify Posts from Custom_Post_Type within the plugin
- Increasing the default number of posts in custom post types
- Group by custom field value (start and end times)
- Ideas to connect external database table to wordpress posts as custom field source
- trying to show single post but displays all post on a custom post type
- Custom Post Type Specific Post Template
- updating one custom meta field only
- Get post-meta value of all custom-posts – lowest to highest year-count?
- Create list from custom field comma separated values
- add_filter get array data before display in custom post_type
- Get previous and next custom post by custom field
- Having a repeating custom field in admin custom post type, what I’d go better with, for DB’s sake? ACF repeater or query a different post type?
- Create an user checklist system for a course plateform using ACF Pro and ACF Extended
- Loop all post on single.php
- WP Admin Dropdown List Filter for custom (ACF) field on custom post type(s)
- WP_Query get always custom post_type for first
- Post Click Redirect to Custom URL instead of Single Post Page
- wp_insert_post deleting previous post custom meta
- Show posts from WP Custom Post Type selected from a field in a metabox
- Query custom post type and custom field by URL parameters
- get_the_terms child terms for current post/custom post only
- meta query multiple values for the same key
- Show Post columns to specific users on condition
- Custom post types – meta_query: search lesson which starts sooner
- custom post type single page
- custom post type single post preview for pending status
- Create Inclusions and exclusions
- Populate custom post type/custom fields from an external database
- Custom Field to post_title
- Automatically convert standard posts with custom fields to custom post types
- Importing URLs of Audio Enclosures
- DIVs not showing correctly on CPT?
- Retrieving custom post type fields without a post
- Get month and day from a Date Picker custom field
- custom fields not showing before get_header
- pre_get_posts with multiple post types AND a meta_key
- Custom Info Box at end of posts?
- Display Custom Post if custom field is marked
- predefined custom field on registration page
- Custom post type single display is ommited
- Query Distinct Taxonomies of Custom Post Type
- Query child posts on parents single.php?
- Select Menu for Custom post Type does not save
- is_singular won’t call my functions?
- loop through custom post-type with two meta_keys
- Allow authors to create article image
- Can I have a specific template for products even if they are standard posts and not CPT?
- Update Custom Field daily within 7days