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

how to show this part only in the single post page?

You can use is_single() in a conditional statement.

<?php if( is_single() ){ ?>
  <ul>
    <li class="Source"><a>source:</a></li>
       <ul class="Source-Link">
           <li><a href="https://wordpress.stackexchange.com/questions/121060/<?php echo get_post_meta($post->ID,"source-link', true); ?>" target="_blank"><?php echo get_post_meta($post->ID, 'source', true); ?></a></li>
       </ul>
    </li>
  </ul>
<?php }?>

Be aware though that this will appear on any single page, meaning a single post page and a single page.

http://codex.wordpress.org/Function_Reference/is_singular

Related Posts:

  1. How to get custom post meta using REST API
  2. What is “meta_input” parameter in wp_insert_post() used for?
  3. The “_encloseme” Meta-Key Conundrum
  4. Using get_post_meta with new_to_publish
  5. Can I count the number of users matching a value in a multiple value key?
  6. Auto sort the wp-admin post list by a meta key
  7. Allow user to create instances of custom field
  8. Is there a hook / action that is triggered when adding or removing a post thumbnail?
  9. Get updated meta data after save_post hook
  10. Save HTML formatted data to post meta using add_post_meta()
  11. Ordering posts by anniversary using only day and month
  12. How to break meta values into different items and avoid duplicates?
  13. ajax delete value from custom field array
  14. Save attachment custom fields on front end
  15. How to use pagination with get_post_meta
  16. Custom fields: In what order are they saved into the DB?
  17. Transition from (classical) serialized custom meta field to (gutenberg) rest enabled meta
  18. Unable to show ACF’s Image Custom Field properly in Genesis Framework [closed]
  19. Custom field value based on other custom field values
  20. Author Page Custom Query WHERE author OR [post meta value] OR [post meta value]
  21. How to display Meta Field Value?
  22. MySQL query to set wp_postmeta using term_taxonomy_id value
  23. How to Validate Post Meta type/extension (Video File Image File etc)
  24. Custom Meta Box not Saving in Posts with Gutenberg Editor
  25. Combine multiple custom field values into single value
  26. How do I use wp_query for WordPress search?
  27. Nav Menu – Add class based on meta keys
  28. How to wrap meta values seperated by comma in ? [closed]
  29. Bulk remove post meta
  30. How to create html block to display extra information on woocommerce single product page
  31. Can’t get post ID using wp_insert_post_data
  32. Unique Post Meta Values
  33. Run a check for multiple meta key values
  34. WordPress Rest API to call page data associate with custom meta
  35. Hide custom meta data if empty
  36. How to create a shortcode to print specific values stored in a post meta array?
  37. Add custom field to all posts in specific post_type
  38. Trying to update_post_meta function
  39. Button inside Custom Meta Box triggering the Update Button
  40. How to load an assets based on custom field value?
  41. get_posts in meta box dropdown not showing latest posts
  42. Limits, not all post are showen when querying for posts by view count
  43. Display Custom Meta Box Field Only If Value is Present
  44. Ordering posts by custom field named “date” in backend
  45. Unique meta_key with array value vs repeated meta_key with single values
  46. Allow only one post with specific meta value
  47. How to validate select field in post meta?
  48. How to display childrens custom fields?
  49. how to display custom fields of post on a web page
  50. How do I query the title (or handle?) of post meta fieldset (created with Simple Fields Plugin)
  51. How to fill custom fields with brackets in their key with add_post_meta()?
  52. Looping inside block return
  53. change order of images attached to post
  54. how can I show name and value of Custom Fields together?
  55. Gravity Forms Update post meta from template [closed]
  56. put saved metabox values back into fields and then display on the front end
  57. Best way to achieve multiple links in a post title
  58. How to get custom image field of specific post id
  59. custom filed from post in the side bar
  60. wordpress multi user question
  61. How can I change author of posts to the value of one of the custom field of the posts?
  62. How to display custom fields in hestia theme
  63. Adding Custom Metadata to my Archive/Posts page
  64. How to improve my non-unique metadata MySQL entries?
  65. Saving Custom Field that includes Quotation marks
  66. Custom Fields Not Showing (ACF not installed)
  67. SQL query to change the value of a Custom Field
  68. Custom meta POST request fired twice when updating a post in Gutenberg
  69. Post meta data not showing in frontend, until hitting ‘update’ button
  70. searching by keywords in post’s metas or pagination links problem
  71. Add custom field information to source meta data
  72. How do I update custom field post meta in frontend post template?
  73. How to Find List of Available Custom Fields for Theme?
  74. update meta field value after
  75. Custom Fields Not Working In Footer
  76. ACF plugin and field update
  77. Delete custom meta
  78. Check if value exists before saving
  79. Echo out custom fields in comments
  80. Get meta value when the page is a blog archive
  81. Search one custom field?
  82. Can’t save meta field value if the title not set
  83. Display Data From This Custom Media Upload Meta Box?
  84. Save values generated via API as custom meta fields
  85. Adding custom fields to images
  86. How to save dynamically generated value in post type?
  87. wordpress simple post multi rating with post_meta and user_meta
  88. update_post_meta not working in action hook
  89. Display meta data from a custom field within plugin Category Grid View Gallery
  90. Custom fields / meta box output
  91. If post custom meta data is not set, show normal state
  92. Colecting values from custom field checkboxes and displaying them in the post
  93. Build Array from Input Fields question
  94. custom field with links
  95. Order by a meta field in query loop
  96. How can i put a custom field inside this php
  97. Site uses wpdb to fetch meta_keys but just displays first meta_key from a page (the post uses the same meta_key “filmmaker” more than once)
  98. How to add new Metadata options (Date, Author, etc.) for Posts?
  99. Saving multiple custom meta box fields
  100. What is the best way to get a different post’s custom field/postmeta with js?
Categories custom-field Tags conditional-tags, custom-field, post-meta
Set option to show the slider in post – WP
Can’t open Custom Post Types Link in navigation

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