Quantcast
Channel: WPRecipes
Browsing latest articles
Browse All 121 View Live

Image may be NSFW.
Clik here to view.

WordPress hack: Show all active plugins

Simply paste this code where you want to display the active plugin list. Once saved, active plugins will be displayed. function wpr_active_site_plugins() { $the_plugs = get_option('active_plugins');...

View Article


Image may be NSFW.
Clik here to view.

How to remove login shake effect when error occurs

Simply paste the following code into your functions.php file: function wps_login_error() { remove_action('login_head', 'wp_shake_js', 12); } add_action('login_head', 'wps_login_error'); Credit:...

View Article


Image may be NSFW.
Clik here to view.

WordPress tip: Modify any role name to fit your needs

Simply paste this code into your function.php file. Edit lines 5 and 6 at your convenience. function wps_change_role_name() { global $wp_roles; if ( ! isset( $wp_roles ) ) $wp_roles = new WP_Roles();...

View Article

Image may be NSFW.
Clik here to view.

How to disable content editor for a specific page template

Before pasting this code in your function.php file, edit line 11 and replace contact.php by the name of the page you want to disable the editor for. add_action( 'admin_init', 'hide_editor' ); function...

View Article

Image may be NSFW.
Clik here to view.

WordPress shortcode to display user registration date

First, place the code below into your theme’s functions.php file and don’t forget to save. function wpb_user_registration_date($atts, $content = null ) { $userlogin = shortcode_atts( array( 'user'...

View Article


Image may be NSFW.
Clik here to view.

How to pre-populate WordPress editor with default content

This code has to be pasted into your theme’s functions.php file. It can be customized to deal with custom post types, as shown on line 16 and after. add_filter( 'default_content',...

View Article

Image may be NSFW.
Clik here to view.

WordPress tip: How to display a disclaimer on posts older than one year

Paste the following code in your single.php file, within the loop. Edited the text on line 7 as desired. <? $ageunix = get_the_time('U'); $days_old_in_seconds = ((time() - $ageunix)); $days_old =...

View Article

Image may be NSFW.
Clik here to view.

WordPress tip: move all JavaScript files to the footer automatically

First, open your functions.php file and paste the following code in it: /** * Filter HTML code and leave allowed/disallowed tags only * * @param string $text Input HTML code. * @param string $tags...

View Article


Image may be NSFW.
Clik here to view.

Downsize your WordPress database by removing transients

First of it all, login to your phpmyadmin and choose your WordPress database. Once done, click on the sql button to open the sql command window. Then, simply paste the following sql command and execute...

View Article


Image may be NSFW.
Clik here to view.

How To Change The Default WordPress Media Uploads Folder

This disappointed many bloggers. Mostly because using a custom media uploads directory made it easier to browse media files in one place rather than having to browse in multiple folders by month and...

View Article
Browsing latest articles
Browse All 121 View Live