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

Image may be NSFW.
Clik here to view.

WordPress hack: Automatic “Nofollow” for external links in post content

Paste the following code snippet in your functions.php file. Once you saved the file, all external links in your post content will be changed to nofollow. add_filter('the_content', 'auto_nofollow');...

View Article


Image may be NSFW.
Clik here to view.

How to disable RSS feeds on your WordPress blog

Paste the code below into your functions.php file. RSS feeds will not be available anymore after you saved the file. unction digwp_disable_feed() { wp_die(__('<h1>Feed not available, please visit...

View Article


Image may be NSFW.
Clik here to view.

How to remove WordPress version number from pages and feeds

Simply paste the code snippet below in your functions.php file: add_filter('the_generator', 'digwp_complete_version_removal'); function digwp_complete_version_removal() { return ''; } Thanks to Jeff...

View Article

Image may be NSFW.
Clik here to view.

How to automatically hide email adresses from spambots on your WordPress blog

Paste the following code into your functions.php file. Once you saved the file, the code will filter content and widget content to hide all e-mails from spambots. function...

View Article

Image may be NSFW.
Clik here to view.

jQuery Slider Shock giveaway: 5 licenses to win!

jQuery Slider Shock is the most complete and awesome slider for jQuery and WordPress ever. It has more than 30 effects and skins, allows external data sources such as Instagram, Flickr, Youtube, RSS,...

View Article


Image may be NSFW.
Clik here to view.

How to create a Pinterest “pin it” button for your WordPress blog

The first thing to do is to paste the following snippet where you'd like the "Pin It" button to be displayed. Note that this code must be inserted within the loop. <a...

View Article

Image may be NSFW.
Clik here to view.

How to use Open Graph to make your content easily recognizable by social...

Simply paste the code below into your functions.php file. The snippet will automatically add the Open Graph metadata to the <head> section of your pages. function wptuts_opengraph_for_posts() {...

View Article

Image may be NSFW.
Clik here to view.

WordPress tip: How to get the first link in posts

The first thing to do is to integrate the function to your theme. To do so, paste this code into your functions.php file. function get_content_link( $content = false, $echo = false ){ if ( $content ===...

View Article


Image may be NSFW.
Clik here to view.

WordPress tip: Add a custom field to all posts

Simply run the following SQL query on your WordPress database, using the command line client or PhpMyAdmin. This will automatically ad a custom field named MyCustomField to all your existing posts....

View Article


Image may be NSFW.
Clik here to view.

Mighty Deals Christmas giveaway

A word about Mighty Deals Mightydeals offers unbelievable deals and discounts for creative professionals.The deals include products and services that are heavily discounted, exclusively for Mighty...

View Article

Image may be NSFW.
Clik here to view.

Shortcode to display external files on your posts

Open your functions.php file and paste the following function in it: function show_file_func( $atts ) { extract( shortcode_atts( array( 'file' => '' ), $atts ) ); if ($file!='') return...

View Article

Image may be NSFW.
Clik here to view.

How to redirect WordPress frontend to the backend

The first thing to do is to open your theme header.php file, and paste the following lines at the top of it: <?php header("Location: ".get_admin_url()); exit(); ?> Once done, your whole site is...

View Article

Image may be NSFW.
Clik here to view.

Automatically add classes to links generated by next_posts_link and...

Paste the following code in your functions.php file: add_filter('next_posts_link_attributes', 'posts_link_attributes'); add_filter('previous_posts_link_attributes', 'posts_link_attributes'); function...

View Article


Image may be NSFW.
Clik here to view.

How to display post attachment count in admin post list

Just paste the code below into your function.php file. Once you saved the file, a new column will display the post attachment count on your admin post list. add_filter('manage_posts_columns',...

View Article

Image may be NSFW.
Clik here to view.

How to prevent WordPress to display login errors

Paste the following line of code into your functions.php file: add_filter('login_errors', create_function('$a', "return null;")); Once you saved the file, WordPress will not display any login error...

View Article


Image may be NSFW.
Clik here to view.

WordPress shortcode to easily integrate a Google Map on your blog

To create the shortcode, paste the code below into your functions.php file: function rockable_googlemap($atts, $content = null) {    extract(shortcode_atts(array(                "width" => '940',...

View Article

Image may be NSFW.
Clik here to view.

How to redirect your author archive link to your “About” page

This code have to be pasted into your functions.php file. Don't forget to replace about on line 4 by the slug used by your "About" page. add_filter( 'author_link', 'my_author_link' ); function...

View Article


Image may be NSFW.
Clik here to view.

ThemeFuse giveaway! 3 premium 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

Image may be NSFW.
Clik here to view.

How to exclude specific categories from your blog homepage

Copy the snippet below in your functions.php file. Replace the category IDs on line 3 with the ones you want to exclude. Then save the file and you're done. function exclude_category_home( $query ) {...

View Article

Image may be NSFW.
Clik here to view.

SQL query to turn categories into tags (and vice versa)

Just run the following query on your WordPress database, and all categories will be turned into tags. Don't forget to replace the table prefix wp_ if your database is using another prefix. And of...

View Article
Browsing all 121 articles
Browse latest View live