Category Archives: How-to

Privacy Policy

Add Privacy Policy Checkbox in Registration Form

By default, the user registration for WordPress is off. Once you enable it, you’ll find it doesn’t let you gather much information from users when they first register on your site. It has basic fields, including Username or Email Address and Password

Custom fields empower you to get extra information from your users, such as an address or phone number, or ask them to accept your Terms & Conditions, Privacy Policy, etc.

Important: The WordPress Checkboxes or checkboxes at any website are legal, as clicking on a checkbox is urging a signature on a written contract.

Here we’ll explain how to add the custom field “Privacy Policy” in the WordPress registration form with custom coding. So, make sure you read this article till the end.

Let’s get started!

Enable WordPress Registration Form

Note: We assume you’ve already enabled the WordPress registration form.

If not, simply go to the left sidebar of the admin dashboard, navigate to Settings, and click the General option.

General Settings

The General Settings screen will open up. Scroll down a bit, and tick mark the Membership checkbox. 

Membership Checkbox

When you are done, scroll done and click on the Save Changes button to save the settings. 

Now you can see the registration link on your login page:

Register Button

Adding Custom Field  “Privacy Policy” on the Registration Form 

Here are going to add the custom “Privacy Policy” checkbox to the user registration form in WordPress. This process will be carried out using custom coding, so buckle up!

1. Hook for Adding Privacy Policy Field on the Registration Form

Note: register_form Allow rendering of new HTML element.

Paste the following code in the child theme’s functions.php file to add the Privacy Policy checkbox on the registration form.

Continue reading
Google drive API, Google Drive PHP API

Diving in Google Drive APIs – List Files and Folders

Today, We are going to actually start playing with Google Drive APIs. Previous parts were base for implementation of web apps with Google APIs. In this part 3, We will use Google Drive functions and list files ,folders and display them at page.

I assume you have already gone through Authentication and Installation process. I have shared my code at github where we are actually moving in a direction to build a simple web app where we will list our Google Drive files and perform operations etc.

Following is a simple function that fetches latest 100 files from user’s Google account and show it on page. We are displaying their file titles and also their icons which represents their file types as well. For example it can be spreadsheet, image or a folder.

Consolusion

If you see my complete web app files, you will see I have managed Authentication and other things in a way that these are VERY easy to understand and follow. In any case, you don’t understand or have a better idea to achieve the same thing I did, shout below in comments 😉

Google drive API, Google Drive PHP API

Diving in Google Drive APIs – Authentication

In this part 2 of the Google Drive Series,  We are going to dig the most important and confusing concept of connecting with Google APIs. Yes, I wrote confusing because there many developers who get confused when they need to implement connectivity of their application to Google APIs. I will try to make this concept easier in this post.

I assume you have read the first part of this series and have created a project in Google Developers Console and before than that have downloaded the PHP Client libraries to play with.

Continue reading

Google drive API, Google Drive PHP API

Diving in Google Drive APIs

Hello developers! I know this is something other than WordPress at WPBrigade but we can’t forget the importance and usage of Google Apps in the WordPress community.

Analytify is one kind of WordPress plugin that uses Google Analytics APIs heavily and simplifying the life of data lovers in WordPress. It displays all the actionable Analytics in one dashboard and shows you Analytics, page by page.

So, I have decided to start a series of blog posts on Google Drive APIs in which I will walk you through some interesting things about the Drive SDK. I will take you from the scratch and reach a point where you will have a good knowledge of Drive SDK and can use it in your future web apps. If this series helps you in any way, shoot it out and Share it with your friends and there is no reason not to take interest in learning Google Drive APIs as it’s usage is totally free.

Continue reading

How to integrate a WordPress blog in your existing website

How To Integrate A WordPress Blog In Your Existing Website?

WordPress is amazing in its nature. You can convert it into anything and integrate it with any PHP website. You can even set the degree of integration. You may only need a few WordPress features when integrating it with your website. For example, you want to display the recent blog posts on your website’s homepage. Your website is in PHP, and a WordPress blog is installed in another folder. In this article, we’ll guide you through the steps to achieve this awesomeness by integrating a WordPress blog into your existing website.

Before starting with the steps to educate yourself on the integration of WordPress Blog in your website, one must know what this web publishing software basically does. And why do you really need to make a WordPress blog after all? So the answer is, why not? As the WordPress blog manages the website content beautifully.  To use this, you don’t need to be a developer or coder. However, for WordPress, there are plenty of auto-installer web hosts that are just one step away and run this easy platform.

So let’s review the suggested steps to integrate a WordPress blog into your existing website and create a beautiful WordPress blog page!

Step1

Let’s assume you already have a site running at http://www.yourwebsite.com/ and you want to start a blog for your Product.

Step2

Create a new subdirectory (folder) at your site and call it ‘blog‘. So you now have an empty sub-directory at http://www.yourwebsite.com/blog/.

Step3

Now, download the WordPress framework and upload all of its files into http://www.yourwebsite.com/blog/ and install WordPress on it. If you don’t know how to install WordPress, please read this tutorial.

So, at this point, you have installed WordPress in the blog directory and want to show the recent blog posts on your website’s homepage.

Step4

You need to add the following code snippet at the start of the home page in which you want to utilize WordPress functions.

<?php 
define('WP_USE_THEMES', false);
require('blog/wp-blog-header.php');
?>

Step5

Then the next important thing is the ‘WordPress loop’. If you’re unfamiliar with the ‘WordPress loop, please read this here.

Put the following code anywhere on your homepage where you want to display the latest posts.

<?php

$number_of_posts = 5;
$args = array( 'numberposts' => $number_of_posts );
$recent_posts = wp_get_recent_posts( $args );
foreach( $recent_posts as $recent_post ){
echo "<span>".$recent_post['post_date']."</span> <br>";
echo "<h3>".$recent_post['post_title']."</h3>";
echo  "<p>".$recent_post['post_content']."</p><br><br>";

}

?>

Pretty simple, isn’t it? This way, you can utilize all the functionality of ‘WordPress’, but you should have a basic understanding of how things are done in ‘WordPress’.

If you are having any difficulties while integrating your website with a WordPress blog, please feel free to ask below in the comments section.

Thanks, Good luck!