This tutorial will teach you how to display a single WordPress post category in your theme even if the article has been posted in a sub category. I created this technique for use in several WordPress themes I have developed where I only wanted to display the actual category that the article was posted in even when posted to sub categories. It’s a nice technique for themes with limited space or users that don’t want to display all categories that a post has been placed in.
Step 1: Creating A Retrieve Actual Category Function
Firstly you will want to open your current themes functions.php file then copy the code block below and paste it into your functions.php file at the bottom, close and save your functions.php file.
Continue reading “Display Single WordPress Post Category Even If Its A Sub Category”
Numbered page navigation is not a feature that comes as standard with WordPress which instead uses its standard blog page navigation style of ← Older posts | Newer posts → in certain themes. If your current WordPress theme does not support numbered page navigation (Lots of them now do) one solution that has been around for a while to easily achieve this function is to install a plugin like WP-Pagenavi.
Continue reading “Add Numbered WordPress Page Navigation To WordPress Without Using Plugins”
This tutorial will teach you how to separate your WordPress comments and trackbacks in WordPress v3.3 and above using some simple jQuery tabs to display the content separately. I have used this technique on several WordPress installs that use the WordPress internal comment system including here on WPShock before I recently changed the sites comment system to use lifefyre.
Continue reading “Separate Comments & Trackbacks In WordPress v3.3+ With jQuery Tabs”
An easy way to trim some size off of your WordPress page loading times is to serve jQuery in your theme from the Google Libraries CDN rather than have your theme load WordPress’s internal version of jQuery which is located on your local server. I have personally used this technique a lot lately when developing WordPress themes to improve a website loading times, also by serving jQuery from Googles CDN you can easily update to the latest version of jQuery by simply changing the version number in a wordpress function.
Continue reading “WordPress Load jQuery From Google Libraries CDN With Local jQuery Fallback”
This WordPress Tutorial will teach you how how to display the WordPress post date as Time Ago eg, “posted 6 Days ago” in place of the more traditional WordPress post date format of 1st May 2012 for example. You will be required to edit some of your WordPress themes template files to achieve this change on an existing theme. As always we also recommend that you use a code focused text editor when editing any template files.
Continue reading “How To Display WordPress Post Date As Time Ago Posted “X” Days Ago”
This neat little WordPress code tutorial will show you how to easily create a WordPress Login Form Shortcode using the wp_login_form() function that can then be placed inside any post or page of your WordPress blog. You will be required to edit a file during this tutorial we recommend that you use a good quality text editor like PSPad or similar when editing any PHP files.
Continue reading “Create A WordPress Login Form Shortcode For Your Blog”