Quantcast
Channel: WPRecipes
Browsing all 121 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

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 Article


Image may be NSFW.
Clik here to view.

Remove “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 Article


Image may be NSFW.
Clik here to view.

How 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 Article

Image may be NSFW.
Clik here to view.

WordPress 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 Article

Image may be NSFW.
Clik here to view.

How 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 Article


Image may be NSFW.
Clik here to view.

WordPress 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 Article

Image may be NSFW.
Clik here to view.

WordPress 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 Article

Image may be NSFW.
Clik here to view.

How 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 Article


Image may be NSFW.
Clik here to view.

WordPress 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 Article


Image may be NSFW.
Clik here to view.

Template 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 Article

Image may be NSFW.
Clik here to view.

Log 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 Article

Image may be NSFW.
Clik here to view.

How 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 Article

Image may be NSFW.
Clik here to view.

How 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 Article


Image may be NSFW.
Clik here to view.

How 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 Article

Image may be NSFW.
Clik here to view.

How 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 Article


Image may be NSFW.
Clik here to view.

WordPress 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 Article

Image may be NSFW.
Clik here to view.

How 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 Article


Image may be NSFW.
Clik here to view.

WordPress 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 Article

Image may be NSFW.
Clik here to view.

How 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 Article

Image may be NSFW.
Clik here to view.

ThemeFuse 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
Browsing all 121 articles
Browse latest View live