Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

Add custom fields after post/page title

There’s the get_post_meta() function to retrieve those data.

So basically, you’d write a function in your functions.php file (or in a custom plugin – take “Hello Dolly” as example) and hook it.

<?php
/* Plugin Name: (#66495) »kaiser« Headway Title Button */
function wpse66495_headway_title_button()
{
    return printf(
         '<div class="title-btn"><a href="https://wordpress.stackexchange.com/questions/66495/%s" alt="https://wordpress.stackexchange.com/questions/66495/%s"><img src="%s /></a></div>'
        ,get_post_meta( get_the_ID(), 'meta_key_link_url', true )
        ,get_the_title()
        ,get_post_meta( get_the_ID(), 'meta_key_thumb_url', true )
    );
}
add_action( 'headway_after_entry_title', 'wpse66495_headway_title_button' );

Related Posts:

  1. Add options to featured image
  2. post meta data clearing on autosave
  3. Assign category using custom field?
  4. What WordPress function to use to get meta value by using meta keys?
  5. Default Custom Field Value Automatically Update
  6. Prevent custom field from being updated after first publish
  7. How to change text color depending on the number value (Using javascript)
  8. Reference multiple style sheets, clearing styles for permalink page, custom fields for css
  9. Creating a “Related Meta” type field?
  10. How to echo the translated custom field?
  11. update_post_meta not working in function
  12. Adding and updating repeating custom field meta data
  13. jQuery does not work
  14. ACF not showing
  15. Why does re-using this function not work? [closed]
  16. Pass parameter to hooked function using custom page template
  17. Override the WordPress core function wp_referer_field
  18. How to return hook data when multiple parameters are present?
  19. Hook into a function without a hook?
  20. Exclude from the query posts with meta_key and meta_value
  21. What is the text that appears beside the page titles in the list of pages in the WP admin?
  22. How to edit the Tags within the image file URLs?
  23. How to retrieve the values of a sub-field in the first and last row of an (ACF) repeater inside function?
  24. Is my code correct to enqueue CSS on a specific page?
  25. Can’t properly set the_title add_filter to show short_URL
  26. How to get correct value from checked()?
  27. Control the srcset much more (not all sizes in it each time)
  28. How to add_filter html template to middle of content
  29. Filter yoast canonical add_action priority [closed]
  30. (Woocommerce) Order by price when entering specific category
  31. Get array of metakey in all posts
  32. How do I hook into the container of wp_nav_menu?
  33. Remove links from the_content when using filters wp_trim_excerpt
  34. Custom Behavior when Adding New Custom Post Type in Dashboard
  35. User function to return multiple get_post_meta()
  36. Is there a way to prevent a function/method from being called outside a specific hook?
  37. Auto log in hook is requiring a page refresh
  38. Hide custom fields when empty
  39. Possible to hook into Media Library preview File column and use a custom image?
  40. Function not working inside of a function in functions.php
  41. What are the meta fields for an attachment?
  42. Adding code before post title with the_title produces weird results
  43. Add back in child theme what the parent theme removed with remove_action
  44. Programmatically add Yoast meta description after post save
  45. Writing a function to detect an event
  46. Insert Address fields into function
  47. This code works, but the way I integrated it is breaking the media uploader. How can I integrate it properly?
  48. WordPress wraps span tags into p tags
  49. How to make custom comment fields required
  50. Changing where my author box is printed
  51. Is it possible to use add_filter in an included file in the child theme’s functions.php?
  52. Insert Content Before div#main from the functions.php File
  53. Add Adsense code between job listings – wp job manager plugin
  54. How add body_class from wp_termmeta
  55. Add a custom class to the body tag using custom fields
  56. How do I display a date correctly that is stored in the database as a backwards 8 digit number from Advanced Custom Fields? [closed]
  57. Sort and display pages with specific custom field (not tag)
  58. update_post_meta is Updating with two page id
  59. shorthand syntax for custom fields
  60. Fill empty custom field with other custom field
  61. Replace admin header logo with an image
  62. Hide a div when a custom field is empty
  63. Why I can’t load my JavaScripts using an hook inside my functions.php file?
  64. is_home() not working in functions.php file
  65. saving/reading custom field value does not work – no value gets POSTed
  66. How to conditionally add a widget via a hook in functions.php
  67. Perform function on publish AND save (not just save)
  68. How to place a div inside a function that creates a div
  69. Changing the text of Upload/Insert on Posts and Pages Screen
  70. Filter for replacing the WP_query object for a given category
  71. How to add or delete default value theme options while activate and deactivate theme
  72. Conditionally run function based on custom meta value?
  73. How to avoid saving empty data to sql while using add_meta_box
  74. How to Display WooCommerce Product Price in WooCommerce Archive
  75. WordPress comment processing . Default unapproved comments detection before posting
  76. Warning at top of website & top menu gone
  77. How to add custom metakey to shop_order page’s searching function?
  78. wp_set_object_term via js btn frontend
  79. Populate Product Regular Price with a calculated ACF Field Value
  80. Does hook have an effect on increasing the page load?
  81. Save_post – Warning: Cannot modify header information
  82. What is the earliest Hook a Script can use?
  83. Populate acf-field, depending on block name
  84. How to use WP conditional tag in a functions.php with OCEANWP Theme?
  85. Update wp_postmeta table based on 2 keys
  86. custom error message for empty username and password using authenticate filter not working
  87. How Do I Unhook This Parent Theme Function?
  88. Get post_author email for Zapier Integration
  89. blank page with wp_get_attachment
  90. How do I get the value of a current user’s custom field?
  91. Calling hooks in functions
  92. How Can I Concatenate A String With One Of My Custom Field Value Before Saving The Post?
  93. Create New User Custom Field not Saving
  94. How To Display Author Popup on Entry Meta (Genesis Framework)?
  95. How would I correctly implement a new if statement in a child functions file?
  96. Hide empty custom field
  97. How to add custom column into custom post, when field is select
  98. How can I stop the hook from breaking the login/logout function?
  99. Remove post from latest posts after a month only with certain tag
  100. save_post doesn’t correctly process function call with php class
Categories functions Tags custom-field, functions, hooks, post-meta
How to change text (date) in post base on the day
How can i display in a archive page a number of post i want

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress