You can try using this:
<?php
$title = get_the_title( $post_id );
$url = urlencode( get_permalink( $post_id ) );
?>
<a class="fb" target="_blank" href="http://www.facebook.com/sharer.php?s=100&pFacebook share button help=<?php echo $title; ?>&p[url]=<?php echo $url; ?>">Share</a>
Related Posts:
- Prevent Javascript Facebook SDK Conflicts in plugin
- Writing a wordpress plugin and trying to include the Facebook PHP SDK
- Custom avatars in wordpress comments?
- disable defaault wordpress comments from a plugin
- Autoloading & Namespaces in WordPress Plugins & Themes: Can it Work?
- How can I add an image upload field directly to a custom write panel?
- Creating a table in the admin-style?
- How to output message during plugin activation
- On the WordPress Admin section how do I link to submenu pages created for a plugin?
- How to return only certain fields using get_posts()
- How to provide translations for a WordPress TinyMCE plugin?
- Scheduled events disappear from events queue
- Where do I start from
- Where is it better to start learning how to develop for WordPress?
- How to log plugin errors to plugin error_log file
- Custom Post Type Link from Plugin
- Is there any way to test if a function running only on plugin update is successfully running?
- Using wp_cron with custom time interval and the register activation hook
- Throw 403 in a plugin [duplicate]
- WordPress multisite apply different options over each site from same plugin
- Using ob_start() in plugin
- Create Element From Dynamic HTML String [closed]
- Change of query var in pre_get_posts not maintained
- Hook for post permalink update
- How can I view all WP generated thumbnails in Media Manager?
- Only allow plugin to be activated on root site of multisite
- Menu Error in Admin Console with Custom Plugin: You do not have sufficient permissions to access this page
- Load page template with custom content using a plugin
- How to put placeholder text in the main post input area?
- Will changing the ‘Plugin Name’ header in the next update of a plugin break anything?
- Performance of several get_option() calls
- Is there a way to list tags order by post_meta field
- Allow Facebook to preview posts before published
- how to redirect to another post without getting headers already sent error?
- Prevent Plugin from loading on ‘wp-admin / wp-login’
- Redirect user to a particular link in 10 seconds after using wp_die
- Getting admin notices working for plugin errors
- Change template dynamically
- add a class when login
- override pluggable.php functions
- An echo line in a transition_post_status action leads to “cannot modify header information – headers already sent by”
- Programmatically detect if wp-cron is disabled?
- Widget is to be compatible with all themes
- How to create a table with filters for my plugin
- How to remove the current post from the query?
- Passing nonce at admin menu link
- wp_insert_user() function password never match
- How to setAttributes in Gutenberg block?
- how to get up row in wordpress with wpdb
- Preview plugin store details
- Prevent third party plugin’s admin page access based on user type
- Get attachments from a post
- How to remove default style of header in wordpress metabox
- I have 2 plugins using the same wp_login action hook and one is not working
- TEMPLATEPATH without the theme name? No THEMEPATH constant?
- Using a multiple element in widget form
- wp_update_post deletes post meta in CPT
- Update Data parameter of a wp_localize_script() call
- flush rewrite rules after plugin update?
- Download button in a plugin’s settings page
- hook filter after the_content on a specific page
- Data not insert and update through ajax and jQuery in admin page?
- Full documentation about $args for register_rest_route?
- WP Plugin with Upgrade option
- How can I control if post updated
- Proper Prepare Statement for ALTER TABLE and using AFTER
- Plugin settings are saving but the fields
- WordPress dynamic widget by location?
- Bootstrap Error in WordPress plugin
- wp_enqueue_scripts in a plugin’s class
- Proper way to create an administration page without adding it to the menu
- Add user managable titles to custom menus?
- WP_Query order posts by category
- How to override supports of innerBlocks?
- Implications of creating a plugin that adds functionality to other developer’s plugin?
- why is update_user_meta creating arrays when trying to change the same value?
- WordPress OOP get current user question?
- Including content into an add_shortcode() function
- How to integrate plugins into block editor
- Override WooCommerce files from plugin
- Add WordPress Meta Box saved form input to WordPress RSS feed [duplicate]
- One-way DB Migration Workflow
- Custom premium registration form and profile page for a WordPress Web Application
- Proper structure for first WP plugin?
- Which filter to use to pre-parse form elements, which are generated by plugin’s shortcode?
- How to Disable Content Warning Dialog for Logged in users
- What should I use instead of get_blog_option?
- How to filter get_adjacent_post()?
- Children Shortcodes?
- How to load another page file of my custom plugin file
- Ajax functions – no access to wp-admin.php only online
- dbDelta not doing what it says
- Custom options page for themes
- I want to encrypt my WordPress plugin
- How can I make my website with wordpress having on-spot editing feature as compared to concrete5 CMS?
- How can i add insertion point between inner blocks in my custom block like core blocks
- Update option hook not firing
- $_GET vs get_query_var()
- Generating Multiple Divi Pages from Database
- Is it smart to require_once wp-admin/includes/plugin.php when you need only one function from it