Source Code

While we discussed and talked about different short codes available out there in our first and second part of this three-part series, today we are going to dig more deeper and will find more snippets – the short codes – which will help you ease your job more while handling different things in your WordPress blog.

Exclude specific categories from your blog homepage

There comes time often when you want to limit the numbers of categories to be on display on the homepage. For doing this, just copy the shortcode below in your functions.php file with replacing 5 and 34 – the category IDs – with the ones you want to exclude.

Source: WP Mayor

Redirect your author archive link to your “About” page

By default, on clicking on your author posts URL, a user gets redirected to your author archive page. It is useful on multi-author blogs, but when you are alone an author on the blog, it’s useless. Adding the shortcode below in your functions.php file will take your readers will take your users to “About” page but also make sure you do replace the slug you used for “About” page on line 4.

Source: WP Recipes

Prevent WordPress to display login errors

By default, when one fail to login on WP-Admin, WordPress displays an error message. It might works well for you as a blog owner but it gives a progress track for hackers. With using the short code into your functions.php file, you will be able to prevent WordPress from displaying login errors.

Source: WP Tuts

Redirect WordPress frontend to the backend

Using the following short code will let you automatically redirect all the frontend part of the site to your WP-admin/login page. Just simply copy and paste the code in your theme’s header.php file.

Source: Vladimir Prelovac

Shortcode to display external files on your posts

Adding the following shortcode to your functions.php file will let you display external files such as text or image on your posts.

Once done, add the following shortcode and you are done:

Source: Vladimir Prelovac

Getting the first link in posts

Using the following snippet will allow you to link a post to somewhere else instead of providing content. Just copy and paste the code into your functions.php file and you are done.

Source: WP Snippets

Remove WordPress version number from pages and feeds

Using the shortcode in your theme’s functions.php file will let you remove WordPress version number from pages and feeds.

Source: Jeff Starr

Load jQuery in the footer

By default, WordPress loads the jQuery JavaScript framework at the top of your files, but using the following shortcode in your functions.php file, will let force WordPress to load jQuery in the theme footer.

Source: Dominik Schilling

Photo Credit: Flickr/Niels Heidenreich