WordPress hack: Efficient SEO without a plugin
Let’s start by pasting the code below into your functions.php file: function basic_wp_seo() { global $page, $paged, $post; $default_keywords = 'wordpress, plugins, themes, design, dev, development,...
View ArticleRemove “Plugins” and “Other News” widgets from WordPress dashboard
Simply paste the code below in your functions.php file. Once you saved the changes, the “plugins” and “other news” widgets will not be shown again. //Remove unwanted widgets from Dashboard function...
View ArticleHow to paginate WordPress like Dribbble
Just paste the code below on your single.php file, where you want to display the dribbble-like pagination: <?php $prev = get_previous_post(); $next = get_next_post(); <div class="float--left...
View ArticleWordPress tip: author bio excerpt
Let’s start by creating the function. The code below have to be pasted into your functions.php file. <?php function author_excerpt (){ $word_limit = 20; // Limit the number of words $more_txt =...
View ArticleHow to change author url base on your WordPress site
Pasting the following code on your functions.php file will change the default yoursite.com/author/name to yoursite.com/profile/name. Replace profile on line 4 by any slug you want. add_action('init',...
View ArticleWordPress tip: How to get the first link in post
Put the function below in your functions.php file, then use it inside the loop in your template files. function get_link_url() { $content = get_the_content(); $has_url = get_url_in_content( $content );...
View ArticleWordPress hack: Redirect to a custom page after registration
Simply drop this snippet in your functions.php or a plugin. function __my_registration_redirect(){ return home_url( '/my-page' ); } add_filter( 'registration_redirect', '__my_registration_redirect' );...
View ArticleHow to order posts by two meta values
Paste the code below in your template file where you need to sort the results of the query. <?php $query = "SELECT wposts.*, wpostmeta1.*, wpostmeta2.* FROM $wpdb->posts wposts,...
View ArticleWordPress tip: Add a custom message to the editing pane
Copy the following snippet and edit the message on line 5. Once done, paste it on your functions.php file and save. function wptutsplus_text_after_title( $post_type ) { ?> <div...
View ArticleTemplate Monster giveaway: 3 WordPress themes to win!
A word about Template Monster Template Monster is a world leader in the web template business, with over 20,000 templates available. They provide HTML templates as well as theme for CMS such as...
View ArticleLog in a WordPress user programmatically
Here is the function, drop it in your functions.php file: function auto_login( $user ) { $username = $user; if ( !is_user_logged_in() ) { $user = get_userdatabylogin( $username ); $user_id =...
View ArticleHow to disable automatic updates in WordPress 3.7
To disable automatic updates, open your wp-config.php file and paste the following line in it: define( 'AUTOMATIC_UPDATER_DISABLED', true ); Once you saved the file, automatic updates will be turned...
View ArticleHow to change contents of a dashboard help tab
Simply paste the code below into your functions.php file. //hook loading of new page and edit page screens add_action('load-page-new.php','add_custom_help_page');...
View ArticleHow to clean up wp_head() without a plugin
Paste the following lines of code into your functions.php file: remove_action( 'wp_head', 'rsd_link' ); remove_action( 'wp_head', 'wlwmanifest_link' ); remove_action( 'wp_head', 'wp_generator' );...
View ArticleHow to add custom text to WordPress login page
Nothing complicated, paste the code below in your functions.php file. Message can be customized on line 3. function wps_login_message( $message ) { if ( empty($message) ){ return "<p...
View ArticleWordPress tip: How to display recently registered users
Simply paste the code below where you want to display recently registered users. This code will display 5 users, you can change this number on line 2. <ul class="recently-user"> <?php...
View ArticleHow to automatically add paragraph tags in WordPress
In order to add paragraph tags to any text, simply use the wpautop() function, as shown below: $my_text = 'Lorem ipsum dolor sit amet consectetur adipiscing elit. Nulla pretium libero eget gravida...
View ArticleWordPress trick: load all posts from the current week
Simply paste the code below where you’d like to load posts from the current week. Then don’t forget to display the results as desired. $query_args = array( 'w' => date( 'W' ), 'year' => date( 'Y'...
View ArticleHow to bring back single-column dashboard in WordPress 3.8
Bringing back the single-column dashboard in WordPress 3.8 is pretty easy: just add this code to your theme’s functions.php file. // force one-column dashboard function...
View ArticleThemeFuse giveaway: 3 premium WordPress themes to win
A word about Themefuse ThemeFuse is one of the most popular actors in the premium WordPress themes market. They provide lots of themes with a great design and solid code. They have lots of different...
View Article