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 share post?

You need to replace the URL paths with:

<?php the_permalink(); ?>

Also consider replacing the title or description text for each button with:

<?php the_title(); ?>

Here”s an example:

<!-- Twitter -->
<a href="http://twitter.com/share?url=<?php the_permalink(); ?>&text=<?php the_title(); ?>" target="_blank"><img src="http://www.simplesharebuttons.com/images/somacro/twitter.png" alt="Twitter" /></a>

This code has been tested within single.php with a standard loop.


Related Posts:

  1. Multiple social buttons with a fast loading? [closed]
  2. how to set social icons to product / post template (Auros theme)? [closed]
  3. Get WordPress post content by post id
  4. Get page ID of page that is set as the posts page
  5. Get Posts Under Custom Taxonomy
  6. How to limit the number of posts that WP_Query gets?
  7. Stop WordPress Wrapping Images In A “P” Tag
  8. When is the ‘post_content_filtered’ column in database cleared by WordPress?
  9. Turn a URL into an Attachment / Post ID
  10. GET the excerpt by ID
  11. Stop WordPress automatically adding tags to post content
  12. Determine if page is the Posts Page
  13. How to get ‘post_content’ without stripping tags?
  14. How to add an admin notice upon post save/update
  15. Print Current Post Index number within Loop
  16. Should we trust the post globals?
  17. Optimize post insert and delete for bulk operations?
  18. Get the Current Page Number
  19. How do you add thumbnail support for custom post types?
  20. How to mark every 3rd post
  21. Change Posts per page count
  22. Keep featured content post in homepage with original order
  23. How to display related posts from same category?
  24. Can posts have parents?
  25. Is there a action hook for the “Empty Trash” button?
  26. How to end the excerpt with a sentence rather than a word?
  27. How do I check if I linked to a post before I delete it?
  28. How to change the case of all post titles to “Title Case”
  29. Appending content with broken in 4.4
  30. How to get posts published between a date and today?
  31. ZIP up all images displayed in a [gallery] and offer as download link
  32. How to detect single.php (but not single-portfolio.php)?
  33. How to check if post meta key exists or not in wordpress database
  34. How to remove a column from the Posts page
  35. removing inline styles from wp-caption div
  36. What is the use of to_ping and pinged column?
  37. How to use “Add link” pop up for a WordPress widget
  38. Remove Categories / Tags From Admin Menu
  39. How to retrieve text only from wp_content() not from wp_excerpt()?
  40. Stop WP from creating “Sample Page” and “Hello World!” post
  41. Where is the old post permalink slug stored?
  42. How to Create Editable Blocks of Text for the Homepage?
  43. Keyboard shortcut for updating a page or post?
  44. Add custom Attachment Display Setting for images
  45. Rewriting post slug before post save
  46. Apply the_title() filter in post & page title, but not in menu title
  47. How to Change Order of Posts in Admin?
  48. is it possible to get next_post_link
  49. Get post content by ID
  50. How to get post creation date?
  51. Update post counts (published, draft, unattached) in admin interface
  52. Function to execute when a post is moved to trash .
  53. How to get post ID of the current page/post inside a widget?
  54. add action only on post publish – not update
  55. How to display by default only published posts/pages in the admin area?
  56. How do you add Read more … link to posts?
  57. How to make comments work for a post loaded per Ajax?
  58. Is there an if statement that can determine if a post in the loop is the last post?
  59. Get current menu_order
  60. How to show related posts by category
  61. Changing the post date and time with function
  62. simply loop through posts
  63. Difference between an archive and a page listing posts
  64. Delete Associated Media Upon Page Deletion
  65. Set Default Listing “View” in Admin
  66. Access post from post id in URL
  67. Count posts within a custom post type and specific taxonomy and terms?
  68. How to add category to: ‘wp-admin/post-new.php’?
  69. Post preview mechanism architecture
  70. How to prevent posts from being published too close to each other?
  71. Passing current cookies in wp_remote_get to get Draft Post Preview
  72. How to hide specific Gutenberg blocks settings from users
  73. Post featured image column on admin post list page
  74. How to Display a List of Users Who Have Made at Least 1 Post?
  75. The next_posts_link() works only with original $wp_query
  76. display all posts in wordpress admin
  77. Front-End Post Submission
  78. Is there a way I can write a series in WordPress?
  79. Get content from one page and show it on another page
  80. Get Next / Prev 3 Posts in Relation to Current Post
  81. How to Check if a Page Exists by URL?
  82. Including categories in search results
  83. How To Disable (or Remove) “All Posts, Published, and Trash” in Dashboard Posts
  84. How to protect pages with double authentication: password + email (in custom field)
  85. How To Have Two Gutenberg Editors On One Post?
  86. Use category base slug in posts’ permalink
  87. Separate Database Tables For Different Post Types
  88. Customizing HTML Editor Quicktags button to open a dialog for choosing insert options
  89. How to change all the guid in posts table?
  90. Removing any and all inline styles from the_content()
  91. Are post ID’s reliable?
  92. Delete post with all files attached to it
  93. Adding additional data to WP_Post object
  94. Get current post id in functions.php
  95. Random sort within an already sorted query
  96. How set featured posts using checkbox in post edit screen?
  97. Hook that get’s triggered when the author of a post is changed
  98. Allow user to “edit_others_posts” to save only, not publish
  99. How to validate XML-RPC post creation and cancel when needed?
  100. Find out who deleted a page or post?
Categories posts Tags posts, social-sharing
What is the best way to setup WordPress for version control and PhpStorm while allowing updates
current_page_item is missing inside wp_nav_menu

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