Archive by Author

Displaying Posts From 3rd Level Sub Categories in WordPress

There’s no denying the fact that WordPress is a high-performance content management system that can be further elevated in its feature set, thanks to the amazing customization possibilities it provides. No matter whether you’re using WordPress for creating any website or a blog, you may would like to display subcategories in your category pages. Segregating […]

Change Featured Image Box Text to Custom Help Text on WordPress Wp-admin

This snippet changes the “Set featured image” text to your custom help text. You can also change the string ‘Your Custom Help Text Here’ for a text that can be changed on your translation/language file e.g. __( ‘Featured image help text’ ). Just copy and paste it on your theme’s functions.php file. ?Download download1.txt1 2 […]

Connect to a Second Database on WordPress and Display Results from It

Let’s suppose you need to connect to a second database on WordPress. The snippet bellow will do it. ?Download download1.txt1 2 3 <?php $secdb = new wpdb(‘secondusername’,’secondpassword’,’seconddatabasename’,’secondhost’); ?> Also you may check this snippet, which will allow you to display a simple result set from the second database. ?Download download2.txt1 2 3 4 5 6 […]

Displaying WordPress Menus Wherever You Want on Your Theme

This is a basic and useful tip a job mate asked me another day. Step 1: copy the snippet 1 and paste it on your functions.php ?Download download1.txt1 2 3 4 5 6 add_action( ‘init’, ‘register_my_menus’ ); function register_my_menus() { register_nav_menus( array(‘top-menu’ => __( ‘Top Menu’ )) ); } Step 2: create your menu on […]

WCCTM PRO and WCCTM, Cool Plugins to Build WooCommerce Product Categories Menus

Hi folks! I’m proud to tell you, I’ve released the plugin I’ve been talking about with some WpWorking Blog readers. There’s a free version of WCCTM(WooCommerce Categories Menu):  And the WCCTM PRO version, with a lot of extra features. Let’s take a better look on it: WCCTM PRO is the amazing PRO version for WCCTM WordPress plugin, […]

Enabling Login by Email on WordPress

Enabling login by email on WordPress is very easy. All you have to do is copy the snippet bellow and paste it on your functions.php ?Download download1.txt1 2 3 4 5 6 7 8 9 10 add_filter(‘authenticate’,’wpw_emaillogin’,20,3); function wpw_emaillogin($user,$username,$password){ if(is_email($username)){ $user = get_user_by_email($username); if ($user){ $username = $user->user_login; } } return wp_authenticate_username_password(null,$username,$password); }

Redirecting After Login on WordPress Depending on User’s Role

This snippet will be useful for redirecting after login on WordPress depending on user’s role. Just put it on your functions.php ?Download download1.txt1 2 3 4 5 6 7 8 9 10 11 function redirusr($user_login, $user) { $usrctx = get_userdatabylogin($user_login); if(in_array("theroleyouwant",$usrctx->roles)){ ?> <script> window.location="<?php echo home_url("/");?>theslugyouwant"; </script> <?php } } add_action(‘wp_login’, ‘redirusr’);