Warning: Constant WP_DEBUG already defined in /home/danfet6/hb-html/wp-config.php on line 97

Warning: Constant WP_DEBUG_DISPLAY already defined in /home/danfet6/hb-html/wp-config.php on line 98

Warning: Constant WP_DEBUG_LOG already defined in /home/danfet6/hb-html/wp-config.php on line 99

Warning: Cannot modify header information - headers already sent by (output started at /home/danfet6/hb-html/wp-config.php:97) in /home/danfet6/hb-html/wp-includes/feed-rss2.php on line 8
Wordpress Guide – Hardik's Blog https://hardik.com.np hardik.com.np Sun, 12 May 2024 05:53:47 +0000 en-US hourly 1 https://wordpress.org/?v=6.9.4 How to enable force http to HTTPS on WordPress? https://hardik.com.np/how-to-enable-force-http-to-https/ https://hardik.com.np/how-to-enable-force-http-to-https/#respond Sun, 12 May 2024 05:53:47 +0000 https://hardik.com.np/?p=43315 An SSL (Secure Sockets Layer) certificate is a digital certificate that authenticates the identity of a website and enables an encrypted connection. Here are some key points about SSL certificates: before you know How to enable force http to HTTPS ?

Encryption: SSL certificates facilitate public-private key pairing, making SSL/TLS encryption possible. Clients (like web browsers) get the public key necessary to open a TLS connection from a server’s SSL certificate.

Authentication: SSL certificates verify that a client is communicating with the correct server that owns the domain. This helps prevent domain spoofing and other types of attacks.


HTTPS: An SSL certificate is necessary for an HTTPS web address. HTTPS is the secure form of HTTP, and HTTPS websites are websites that have their traffic encrypted by SSL/TLS.


Certificate Information: SSL certificates include information like the domain name for which the certificate was issued, the person, organization, or device it was issued to, the certificate authority that issued it, associated subdomains, issue date, expiration date, and the public key.

Trust: The most important part of an SSL certificate is that it is digitally signed by a trusted Certificate Authority (CA). Browsers trust certificates that come from an organization on their list of trusted CAs.

In essence, an SSL certificate is essential for maintaining the security and trustworthiness of a website. It ensures that user data remains secure, verifies the ownership of the website, prevents attackers from creating a fake version of the site, and gains user trust.

Tutorial About How to enable force http to HTTPS ?

An SSL certificate is included in the Beginner plan and higher and will be issued and activated for domains using your site’s name servers. This means that besides HTTP, HTTPS will also work for your site with us.

In this tutorial, we show you how to automatically redirect your HTTP website to HTTPS, ensuring that your website visitors always use HTTPS using htaccess file. 

Step 1 – Go to File Manager in the Control Panel
Step 2 – Create an .htaccess file
Step 3 – Edit the .htaccess file
Step 4 – Paste in the configuration

Paste the configuration below in the text editor and click Save at the top of the screen.

#Rewrite everything to https
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

 

Now, reload your website, voila your site loading with secure https. Thank me later. 😀 

 

Check this link for all blogging tips and tricks: https://hardik.com.np/category/blogging/

]]>
https://hardik.com.np/how-to-enable-force-http-to-https/feed/ 0
How to Add Facebook Comments on WordPress Without Using A Plugin https://hardik.com.np/how-to-add-facebook-comments-on-wordpress-without-using-a-plugin/ https://hardik.com.np/how-to-add-facebook-comments-on-wordpress-without-using-a-plugin/#respond Sat, 16 Oct 2021 17:15:13 +0000 https://hardik.com.np/?p=43303

Why is it better to manually install Facebook Comments rather than use a plugin?

Here are just a few reasons:

  1. Plugins tend to have unnecessary code in addition to serving their core functions, which may slow down your site. Especially if you have a lot of WordPress plugins installed already. It’s always best to limit the amount of plugins you have, when you can.
  2. It’s more secure. Plugins, especially non-updated plugins, are prone to hacker attacks and malware injection. Which can cause nightmares for your site if not protected properly.
  3. And lastly, it’s not that hard. As you’ll discover below, the whole process only takes a few minutes to complete.

Step 1: Initial Setup of Facebook Comments

The first step is to visit the official Facebook Comments Plugin developer page and setup your comments settings. While you don’t need to generate the code from this page as we provide it all below, it’s good to test it out and get a feel for what it will look like on your website.

Once you’re done testing… go to Appearance > Editor inside your WordPress backend.

 

Place the code below right after the opening <body> tag (usually located in the header.php file).

 

Without Facebook APP ID

<div id="fb-root"></div> 
<script async defer crossorigin="anonymous" src="https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v12.0" nonce="vtHh10Cd"></script>

 

With Facebook APP ID

Use this code (with FB App ID) if you plan to moderate comments.

<div id="fb-root"></div> 
<script async defer crossorigin="anonymous" src="https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v12.0&appId=YOURAPPID" nonce="vtHh10Cd"></script>
Note: To add your Facebook App ID, append the src attribute with &appId=YOURAPPID (as seen above in red).

It’s also recommended by Facebook to add the following meta tag in the <head>
section:

<meta property="fb:app_id" content="YOURAPPID" />

To view the full list of tags and display options, visit the Facebook Comments settings section.

This is an example of what the code could look like when adding it to WordPress:

 

Facebook Comments code for WordPress body html tag

Example of header.php code

 

 

Step 2: Installing Facebook Comments Code

Place the code below where you would like the Facebook Comments to show up on your website.

Unlike the code given to you from the official Facebook Comments site, the code below utilizes dynamic URL functions within WordPress to make the FB Comments code unique for each page of your website.

Most themes use a file named single.php to manage the blog post section.

<div class="fb-comments" data-href="<?php the_permalink(); ?>" data-width="100%" data-numposts="10" data-order-by="social" data-colorscheme="light"></div>

 

Here’s an example of what the code could look like when you add it to WordPress:

FB Comments code for WordPress single post

Example of FB Comments Code Placement in WordPress

 

Facebook Comments Settings

  • For dynamic URLs, edit the data-href section to include <?php the_permalink(); ?>
  • To enable lazy loading, add the boolean data-lazy attribute and set to “true” (default is “false” and not listed)
  • For mobile and/or responsive comments, change data-width to a percentage such as 100% to make it have a fluid/responsive width and/or use the boolean attribute data-mobile to use the mobile-optimized version of FB Comments when detected (auto-detected).
  • Use data-numposts to control the amount of comments that show up per comments page.
  • The order of comments can either be displayed by social signals “social” (default), also known as “top“, or by the latest date/time it was given (“time“, “reverse_time“) through the data-order-by tag.
  • Edit the color theme through the data-colorscheme tag. Make it either light (default) or dark.

Changing the Language

If you’d like to change the default language of your Facebook Comments just update the src value from en_US (English, United States) to whichever language and locale you’d prefer.

For example:
src="https://connect.facebook.net/es_MX/sdk.js#xfbml=1"

This would change the default language to Spanish and the country to Mexico.

Facebook supports many ISO languages and country codes. Learn more about Facebook localization.

 

Step 3: Test and Verify

Once you are finished placing the two snippets of code on your site, visit a few of your blog posts to verify that the Facebook Comments are functioning and displaying properly.

Each page/post should have its own unique set of comments and be generating them automatically.

The final product should look something like this:

 

Facebook Comments example on WordPress site

Example of Facebook Comments working properly

 

 

That’s it!

I hope this post was helpful for you in installing Facebook Comments on your WordPress website.

]]>
https://hardik.com.np/how-to-add-facebook-comments-on-wordpress-without-using-a-plugin/feed/ 0