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

Social sharing plugin directing to blank page after post sharing

By putting your own php code inside the post editor to select posts and render them, you are evading all mechanisms that WordPress has to do this for you.

By the time you get to do_shortcode('[Social9_Share]') you have echoed a post, but does Social9 know which one? No. As far as Social9 is concerned you want to share the parent post, the one within which you have included the php code. You may run through ten posts inside your foreach loop, but everytime Social9 will echo a button trying to share the parent post.

If that parent post is your homepage, that’s what you are sharing.

Moral: NEVER EVER use php in your posts. Use pre_get_posts in combination with is_page to select a certain range of posts on certain pages.

Update: the latter should be included in the functions.php file of your (child) theme.

Related Posts:

  1. Social share buttons text shows up on post excerpts
  2. Why is it important to check for isset and is_array before checking in_array in this example?
  3. Adding a simple Javascript file with a plugin
  4. WordPress custom post type image in RSS
  5. How to add/change (woocommerce) product tab icon
  6. How to delete a theme using AJAX
  7. speed up pagination for huge database
  8. dynamically create callback functions inside a for loop
  9. Comment “like” problem – “users who like this” avatar linking to current user profile instead of “liker’s” profile
  10. I want to generate the pdf and save it in library?
  11. Profile / benchmark wordpress on apache?
  12. Way to send multiple values for column to MySQL?
  13. Using meta_query in a WP_Query not working for numbers properly
  14. Add the_post_thumbnail_url to a shortcode in function.php
  15. Inserting Plugins Into Blank Space of Externally Designed WordPress Theme
  16. Add key and value to an array in another file
  17. Calling a save function from a “submit” button
  18. File Uploader – Upload without adding to Media Library
  19. ACF – How to set the menu order for the relationship field
  20. Creating an admin meta box to save post as pending
  21. Custom search search does not work?
  22. Must use Plugin not updating HTML code in head
  23. Wierd site output [closed]
  24. Wp Debug Enabled True Notices and Warning
  25. How to call external functions from a PHP script in a WordPress plugin?
  26. How to change layout of shop page in wordpress? [closed]
  27. How to write to a separate PHP file in plugin settings
  28. Pagination shows Same posts
  29. Add logo to admin menu in my plugin
  30. same user role or copy the user role to be same as the other role
  31. Trying to make a simple wordpress plugin, having difficulties understanding how to make it?
  32. Plugin not working locally, but works on server
  33. Disable Checkbox depending on state of another checkbox
  34. Passing PHP Variables to AJAX Loaded Pages
  35. Custom meta box with jQuery.sortable custom post type list
  36. preg_replace() No ending delimiter ‘.’ found [closed]
  37. Building a plugin into a theme
  38. 2 wordpress site same database
  39. How to redirect to a page after the form is submitted
  40. “Allowed memory size” problem [closed]
  41. Echo out element to another page.
  42. Equivalent of admin.php for public pages
  43. Get data from wp_posts of mysql in to variables of wordpress-php script
  44. WordPress plugin won’t create custom tables
  45. Retrieve Plugin Settings and insert into XML string
  46. wordpress plugin license issue -New plugin development
  47. Create “new pages” within the admin section of plugin
  48. Passing value as hidden parameter to next page
  49. Trying to include files in plugin isn’t working
  50. Next Previous Post in wordpress with previous / next link with title?
  51. Cannot access empty property error in Advanced Access Manager
  52. Dynamic Image Replacement through call rail phone call tracking plugins in wordpress
  53. How can I show registration form inside modal?
  54. WordPress truncate posts question (plugin related)
  55. Different registration form for different roles
  56. Trying to get property of non-object wordpress error message
  57. Theme Functions run a function upon activation or preview
  58. Is this plugin safe to run?
  59. Adding a Tag Parameter / Filter to My Shortcode
  60. More gentle way to hook WordPress custom url
  61. Categories from front-end, checkbox selection doesn’t work
  62. Apply html elements in php statement
  63. How to display results from a data table with an encrypted user id?
  64. How to add custom function to pluggable.php
  65. WordPress Post HTML after Posting
  66. Settings options not showing up on Sub Menu page in WordPress plugin
  67. WordPress Stats Plugin: Display Post Views [closed]
  68. Pagination not working
  69. Advertising: Every page refresh counts as 3 ad impressions
  70. exec-PHP shows output at bottom of page
  71. Somehow adding to “Insert Into URL” posts are contradicting each other
  72. Pasting this PHP breaks my page. Why?
  73. Check against server time to display SQL entries – Radio Station DJ Rotator Plugin
  74. Modify pages widget and make a plugin?
  75. Can you echo PHP code from a variable?
  76. Cannot Access Console
  77. eaccelerator PHP error
  78. Looking for a good way to include php code in posts, but using special include markup rather than direct php code
  79. Plugin error after installation
  80. How to fix these PHP Warnings with the “Feed JSON” plug-in?
  81. WP Subtitle Plugin Problem
  82. WP Insert Post If user refreshes override new post
  83. add_action for publish_post doesn’t work
  84. How to displaying Custom image, text and default image logo from Redux Framework option panel
  85. How to proper escape echo inside a javascript tag
  86. Plugin Admin panel checkbox unchecked after submit
  87. uncaught TypeError: Cannot read properties of null (reading ‘classList’) custom plugin
  88. Custom Plugin scripts from admin working in frontend
  89. WordPress Cache delete on plugin uninstall
  90. How to create repeater field manually, without plugin (ACF Pro)?
  91. Code for unique user visit count on every page WordPress
  92. Getting URL GET parameter with Code snippets and storing it in database?
  93. Creating New Dynamic Fields for a Certificate (Number Generation, Code Referencing, and more)
  94. Searching a tab/space delimited text file based upon form criteria and returning a ‘record’ into a word press results page
  95. Ajax call not working in wordpress through a plugin
  96. Send Array from JS to php file then insert it in wp database through a plugin
  97. Offer Download Links for Product Images
  98. can’t unzip file
  99. How to Call Specific .PHP file on add_submenu_page selection in Plugin Development?
  100. Get product categories and add them to a custom taxonomy
Categories plugins Tags php, plugins, social-sharing
Creating an Angular factory from custom database table
Mysql Queries per Visit – Crazy High

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