Archive | Workarounds

RSS feed for this section

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 […]

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 […]

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’);

WooCommerce, How To List Product Categories(With Thumbnails) and Subcategories

IMPORTANT UPDATE! Check out WCCTM PRO, a plugin that provides custom toggle, list and select field menus based on Woocomerce Product Categories. This code snippet may help you to list product categories and subcategories on your blog or website. This code snippet may help you to list product categories and subcategories on your blog or […]

New Plugin, Gambit Arrow Custom Front End Translator

I’m glad to tell you my new plugin Gambit Arrow Custom Front End Translator is available on the WordPress Plugin Directory. A supplement to the qTranslate plugin which also works independently, Translate words written directly on HTML source code, Custom Words Translator for Front End Words on HTML(portuguese, english, spanish), can be customized for other languages […]

Display All Images From a WordPress Post on a List(Separate Content Images and Text)

This function makes possible for you to display all images from a WordPress post on a list. Copy and paste the code bellow on your functions.php file. ?Download download1.txt1 2 3 4 5 6 7 8 9 10 11 12 function fnGetImgs($content){ preg_match_all(‘/<img[^>]+./’,$content,$imgarr); $totimgs = count($imgarr[0]); if ($totimgs > 0){ $resimgs = "<ul id=’imgspost’>"; for […]