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:
- Social share buttons text shows up on post excerpts
- Should all plugins be encapsulated in a Class?
- Preserve custom URL parameter on more pages
- PHP code on Visual Composer Plugin
- if plugin is active? check if plugin is enabled or not?
- Making plugin unique to not conflict with plugins with the same name
- How to find out if option exists but is empty?
- How to store ACF custom fields data in a custom table
- Trying to disable plugins doens’t work
- Thumb rating for wordpress – top user
- Errors while using ajax from external wordpress page
- Have Plugin Handle Specific URLs
- Setting up widgets in wordpress with a unique ID for the after_title argument
- post expire after x days
- allow arabic letters when register new account
- How to get all events from ‘All in one Events calender’ plugin in JSON format?
- cURL error 60: SSL certificate problem: unable to get local issuer certificate
- How to Replace Words with Hypertext Link But Ignore Previously Existed Links?
- How do you remove plugin edit option?
- Make specific products accessible only to a user role in WooCommerce
- Where should I save an API key of my user when installing my plugin?
- Accessing post’s meta data based on user’s click of a post
- Custom form action to handle data inside a plugin
- WP Post Template – Templates in own folder
- How to add equivalent of php include to one page (as plugin?)
- Override Plugin Script Fucnction in WordPress
- Image upload and download from front-end
- Shrink down register_settings on Settings API
- Parse error: syntax error, unexpected ‘new’ (T_NEW) in /misc/41/000/204/381/9/user/web/ragami.net/wp-settings.php on line 219
- How to call WordPress function other files
- Removing an action from wp_footer called in a class that’s inside a bigger class
- Ajax call returning 0
- Some code in shortcode function being ignored
- Subdomains with almost the same content
- Using window.onload with Ubermenu
- What is @Action in WordPress?
- How to include this jQuery File in wordpress?
- Inserting custom PHP script on homepage
- Add bcc to contact from on wordpress
- Getting taxonomy images to display on single-post with their terms
- Custom shortcode for displaying user based on a role parameter
- wp_enqueue_scripts
- WordPress Console Application (ability to excecute a custom function via crontab only)
- Get all the URLs of the pages that uses a specific shortcode
- Wp Debug Enabled True Notices and Warning
- Pagination shows Same posts
- Theme Functions run a function upon activation or preview
- Is this plugin safe to run?
- WP Subtitle Plugin Problem
- Custom Plugin scripts from admin working in frontend
- WooComerce Deposit: set specific shipping method and quantity based deposit amount
- How to get brand children with woocommerce brands
- Prevent WordPress from sending set-cookie http header
- Is there any way to sync Facebook Comments and with comments on WordPress website?
- How to add a prefix to a WordPress post preview url?
- i can not access the post in custom template of my wordpress plugin
- How to get a specific string from a url
- location lock wordpress website
- Use AJAX to fetch Current Post Thumbnail for WordPress when Uploaded throughMedia Uploader Frontend
- Easiest way to load/fire a handful of functions, IF checkbox is checked?
- How to avoid the 403 Forbidden error in a WP Plugin with Ajax and PHP
- How much PHP and MySQL or MariaDB knowledge should I know to start writing WordPress themes and plug-ins and whatever else a beginner can edit?
- post id or permalink auto-incrementing number and reset everyday
- How To Use htaccess to Rewrite Link Structure for a Page that is Generated Programatcially
- WordPress logout appends cache/all/index.php to the site_url()
- WordPress Sumo Plugin not showing all images on clicking pinterest icon
- Reverse count page view and show on other page
- Change (replace) word in metabox
- Caching of combined CSS and JS fails because of losing MIME types through combining by PHP
- Change pricing in Woocommerce based on Category and Product [closed]
- Register setting on plugin activation
- WordPress environment not loading properly
- How to remove a css class for any wordpress page
- WordPress not displaying information on post sent from custom admin form
- Displaying friend’s posts only
- using href when creating wordpress plugin calls empty page instead of php file
- Media Playlist Plugin
- Saving custom form fields
- How to add php stylesheet to admin section instead of admin_head hook
- Template from scratch: Sidebars not showing widget
- Contact Form 7: custom validation [closed]
- Enforce conditions only for draft posts using WyPiekacz, ignore pending and published posts
- Replace Dash (-) and Underscore ( _ ) with Space
- How use Dynamic hyperlink on each wordpress post?
- How to add homepage Widget?
- What can I do to customize a widget provided with this plugin? from where have I to start?
- WordPress create permalink structure for custom post type with userid
- Shortcode inside a redirect [closed]
- Attachement title in wpallimport
- Block registration with viewScript
- Refresh server side rendered block in Gutenberg without changing attributes or its content
- Option value not getting updated until page refresh in WordPress
- Fatal error: Uncaught Error: Call to a member function fetch_array() on bool
- I want create woocommerec match products columns
- WordPress Custom Page Blog Template Pagination Problem (Pagination Not Displaying)
- How to override plugin function in code snippets WordPress
- How to create a “Most Popular” & “Latest” TAB in WordPress
- WordPress Share Buttons Plugin: How do you make the WordPress Share Buttons Display Vertically?
- Use inline callable for hooks and filters
- Error in using ‘admin_enqueue_scripts’ action through a class