Facebook like button disappears after changing the static permalink to dynamic one!

It appears that you forgot to close your PHP code correctly using ?>, try the following: <li class=”fb-like fb” data-href=”https://wordpress.stackexchange.com/questions/110669/<?php the_permalink(); ?>” data-layout=”button_count” data-show-faces=”true” data-send=”false”></li> For the future, you can easily view the source of the page and check if the_permalink was correctly inserted.

Post on facebook when I publish blog

As Robert hue said, you’ll have to use a plugin for this. There are plenty in the Plugin directory, but you could also write your own plugin (or add the code to your theme’s functions.php file) if you can’t find a suitable one or need more functionality. You’ll want to hook into the publish_post action. … Read more

Include Facebook Javascript SDK In WordPress

I’m assuming you’re referring to the header.php file of your theme. In that case, it’s as easy as just enqueueing the script by appending this function to your theme’s functions.php file: function enqueue_facebook_javascript_sdk(): void { wp_enqueue_script( ‘facebook-javascript-sdk-initializer’, get_template_directory_uri() . ‘/path/to/your/initializer.js’ ); wp_enqueue_script( ‘facebook-javascript-sdk’, ‘https://connect.facebook.net/en_US/sdk.js’, array(), null ); return; } add_action( ‘wp_enqueue_scripts’, ‘enqueue_facebook_javascript_sdk’ ); The first … Read more