How Do I Create a Social Login in WordPress?
Creating a social login in WordPress is a fairly straightforward process. First, create a new custom post type in your WordPress administration area.
For this example, we’ll call our new social login post type “Social Login”.
Next, add the following code to your new social login post type’s custom post type page:
__( ‘A social login post type for WordPress.’ ), ‘labels’ => array( ‘name’ => __( ‘Social Login Post Type’ ), ‘singular_name’ => __( ‘Social Login’ ), ‘plural_name’ => __( ‘Social Login Posts’ ), ‘display_name’ => __( ‘Social Login’ ), ‘menu_title’ => __( ‘Social Login’ ), ‘parent_title’ => ‘Primary Category’, ‘show_in_nav_menu’ => true, ‘show_in_search_menu’ => true, ‘show_in_nav_menus’ => true, ‘show_in_search_menus’ => true, ‘menu_order’ => 5, ‘post_type_name’ => ‘Social Login’, ‘public’ => true, ‘exclude_from_search’ => true, ‘slug’ => ‘social-login’, ‘has_archive’ => true, ‘exclude_from_meta’ => true, ‘show_in_sidebar’ => true, ‘inherit_parent_post_type’ => true, ), ‘taxonomies’ => array( ‘category’ => array( ‘taxonomy’ => ‘post_type’, ‘terms’ => array( ‘social-login’ ) ), ‘post’ => array( ‘taxonomy’ => ‘post_type’, ‘terms’ => array( ‘social-login’ ) ), ‘page’ => array( ‘taxonomy’ => ‘page_type’, ‘terms’ => array( ‘social-login’ ) ), ), ‘public’ => true, ‘exclude_from_search’ => true, ‘slug’ => ‘social-login’, ‘has_archive’ => true, ‘exclude_from_meta’ => true, ‘show_in_sidebar’ => true, ‘inherit_parent_post_type’ => true, ) ) );
We’re registering our new social login post type with the WordPress administration area. This will allow us to create social login posts later on.
Next, add the following code to your social login post type’s custom post type page:
__( ‘Social Login Taxonomy’ ), ‘description’ => __( ‘A custom taxonomy for social login posts.’ ), ‘labels’ => array( ‘name’ => __( ‘Social Login Taxonomy’ ), ‘singular_name’ => __( ‘Social Login Post Type’, ‘plural_name’ => __( ‘Social Login Posts’, ‘display_name’ => __( ‘Social Login Taxonomy’ ), ‘menu_title’ => __( ‘Social Login Taxonomy’ ), ‘parent_title’ => ‘Primary Category’, ‘show_in_nav_menu’ => true, ‘show_in_search_menu’ => true, ‘show_in_nav_menus’ => true, ‘show_in_search_menus’ => true, ‘menu_order’ => 10, ‘post_type_name’ => ‘Social Login Taxonomy’, ‘public’ => true, ‘exclude_from_search’ => true, ‘slug’ => ‘social-login-taxonomy’, ‘has_archive’ => true, ‘exclude_from_meta’ => true, ‘show_in_sidebar’ => true, ‘inherit_parent_post_type’ => true, ), ‘taxonomies’ => array( ‘category’ => array( ‘taxonomy’ => ‘category_type’, ‘terms’ => array( ‘social-login’ ) ), ‘post_type’ => array( ‘taxonomy’ => ‘post_type’, ‘terms’ => array( ‘social-login’ ) ), ‘page’ => array( ‘taxonomy’ => ‘page_type’, ‘terms’ => array( ‘social-login’ ) ), ), ‘public’ => true, ‘exclude_from_search’ => true, ‘slug’ => ‘social-login-taxonomy’, ‘has_archive’ => true, ‘exclude_from_meta’ => true, ‘show.