This is the answer – code to be added in the functions.php:
add_filter( 'the_content', 'my_the_content_filter', 0 );
function my_the_content_filter( $content ) {
if ( is_single() )
{
global $post;
$pgLnk=get_post_meta($post->ID, 'Button', true);
$content .= '<div id="button-link"><a href="'.$pgLnk.'" target="_blank">
<span class="button-link"></span></a></div>';
}
return $content;
}
This code was wrote by @Sheikh Heera on stackoverflow.com – direct link
Related Posts:
- How do I assign this filter to a variable? (Appending php & markup to the_content)
- Save the_content into custom field
- More efficient to add content to custom fields or the content area?
- Filter post style attribute
- How to add content with a filter when there’s no content in the editor
- Empty the_content for all posts
- Include custom fields into the content of a regular page
- WP_Query – Order results by meta value
- Custom query with orderby meta_value of custom field
- Difference between meta keys with _ and without _ [duplicate]
- Orderby meta_value only returns posts that have existing meta_key
- How to enable revisions for post meta data?
- Any way to add custom options to Gallery Settings?
- Can I query custom meta data through WP_Query
- Including custom fields in search?
- Add custom objects/entities to WordPress
- Change behavior of “Insert into Post” based on attachment metadata
- Sort posts by custom field numeric value using dropdown
- How to position a custom field before the editor
- How can I display all values of a custom field from posts with a certain value of another custom field or from certain post types?
- passing argument to get_template_part() or a better way to code
- Is there a way to do multiple ordering on a multiple meta_query?
- searching in custom meta field
- How to add upload field in a custom taxonomy?
- Display thumbnail from custom field
- Bulk move (or copy) from a custom field to the post content?
- Store JSON in a custom field
- Getting Custom Field data from a page hierarchy
- Custom contact form 7 select with custom values [closed]
- limit amount of photos uploaded per cpt post
- Problem with adding exta field in metabox in custom post type
- Setting orderby to a custom field using pre_get_posts
- little help with a mySQL query to wp database
- Add WYSIWYG to Image Description field
- Calling custom profile fields?
- How to get multiple checkboxes in one meta field
- Adding Custom Fields to Search
- How to Display Custom Meta Box only on Specific Page IDs
- Get custom field label
- Show ACF fields only on certain page in the backend
- Performance of storing multiple meta fields vs one JSON encoded field [duplicate]
- How make a custom search on backend in WordPress without plugin?
- Create Multiple File Upload Metabox in WordPress
- WP_User_Query pulling ACF to loop
- how to put a custom field value in variable
- Custom Metabox Not Saving
- How to add the image URL from an external RSS feed and insert into a custom field?
- My custom backend codes shows up when i try to view my website
- Advanced Custom Fields dynamic update_field
- Custom Profile Fields move from BBpress to BuddyPress
- How can I output a list of values for a custom field, and posts with those values?
- Manipulate javascript code from custom made admin page menu
- Add additional ‘description’ field for defined roles / role metadata?
- Change the main loop WordPress impact on the server?
- How to get categories with posts by custom field value?
- I need a “Choose from existing content” popin
- For homepage images (for small business website), is it better to use custom fields or post_thumbnail?
- Avoiding ACF get_field and returning to core WordPress function
- Walker class for sub-menu with ACF fields
- Display custom field value part by part?
- Add custom fields to existing posts (admin pages)
- How can I hide custom field from users used for caching response from external api?
- How do i get the attached images with custom value checked?
- How to disable Edit Post and Allow only Custom Field?
- Convert attachment ID into url?
- Cannot save underscore custom fields in one wordpress installation using xmlrpc and underscores
- Diamond question mark in text after migrating content
- Display posts with empty custom field
- Custom Fields Question
- do_shortcode close
- Add custom data (field) to sidebar widgets for later display
- How do I convert all custom_field php timestamps in the database to js timestamps?
- Display custom field value as a mailto: link
- Display custom field only if it has a value
- Make separate text boxes for separate WordPress Custom Fields
- Sort by an ACF field in a tax_query
- How do I display an article using a WordPress custom field?
- Custom field metabox not showing in back-end
- Load one page with parent and child pages
- Why can’t I get the correct post permalink
- Use a different catalog image than the featured image
- Login Api with Meta_key and Meta_value
- Query Multiple meta
- Ordering posts by custom fields
- How to diplay a div only if at least one author custom profile field is filled?
- Set custom field value when reaching expiration date
- Show message if statement is false – foreach
- Order by custom field in query multiple
- Returning website screenshot based on Custom Field
- How to allow user to add to, but not edit, a post?
- Filtering posts by WORD in custom field
- How to query posts that have certain post meta keys, and sort by meta key and/or value
- How to implement jquery-ui autocomplete into custom fields?
- Add image custom attribute [closed]
- i want to send email on custom post field (job_status == 2) but it is not working
- Foreach giving one too many list items, how can I remove the last empty line?
- I used a custom field for header image and can’t get it to show up on posts
- How to create a searchable database with a single-field search box at the front end? [closed]
- Add custom fields to specific menus
- How to apply Local Business Google Schema dynamically on a Custom Post single template?