WordPress Development, WP Code Snippet
In URL extension action PHP if condition use
In this tune I am going to discuss about how to use php if condition in url extension. One of my client use “wordpress-wiki-plugin” in a website. If you are use the plugin every single post show two additional menu like tab menu name “Discussion” and “History”. Client want to remove some section when in… Read More
WordPress Development, WP Code Snippet
Create custom WordPress registration form
Registration form is very important for user registration. Though wordpress has a default registration form and url. Simple take below function in your wordpress functions.php file. class jeba_registration_form { private $username; private $email; private $password; private $website; private $first_name; private $last_name; private $nickname; private $bio; function __construct() { add_shortcode('jeba_registration_form', array($this, 'shortcode')); add_action('wp_enqueue_scripts', array($this, 'flat_ui_kit')); }… Read More
Wordpress Security, WP Code Snippet
Limit Login Attempts Without Plugin
We know that limit login attempts is very important for wordpress security. In this tune I am going to describe how to use limit login attempts without using plugin. The limit login attempts very easy to use in your wordpress site. Just add below function in your theme functions.php file. /** * CLASS LIMIT LOGIN… Read More
WP Code Snippet
Preventing Access wp-admin From Users
To more secure wordpress website can preventing access wp-admin from user. Only administrator can be access the site wp-admin. For prevent access wp-admin from user just take below function in your theme functions.php file. function jeba_blockusers_init() { if ( is_admin() && ! current_user_can( 'administrator' ) && ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) )… Read More
WP Code Snippet
Add Custom Post Types to Main Loop
function add_to_main_loop($query) { if ($query->is_main_query()) { $query->set('post_type', array('post','POST_TYPE')); } } add_action('pre_get_posts', 'add_to_main_loop'); Read More