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.
How To Display WordPress Post Date As Time Ago Posted “X” Days Ago
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.
WordPress Load jQuery From Google Libraries CDN With Local jQuery Fallback
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.
[Read more…]
Separate Comments & Trackbacks In WordPress v3.3+ With jQuery Tabs
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.
[Read more…]
Add Numbered WordPress Page Navigation To WordPress Without Using Plugins
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.
[Read more…]
Create A WordPress Post Source Root Domain URL From An External Sites Full Article URL
Recently when creating a tumblr style theme for wordpress I wanted include a source article link in the wordpress post_type links linking back to the original article. When I was displaying the source link I wanted it to display only the sites root domain as the source rather than the full url of the article. This tutorial will teach you how to achieve this through a php function that you can easily place within your own themes functions.php file to get the same feature on your existing wordpress site.
[Read more…]
Display Single WordPress Post Category Even If Its A Sub Category
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.
[Read more…]
How To Add Different Background Images To WordPress Post and Pages
One of the most commonly requested features I see users of WordPress asking is “how do I add different background images for individual pages or posts on my site”. There are many approaches to achieving this from using purely CSS or alternatively PHP with WordPress conditional tags, what if you don’t have the skills required skill-set to write CSS or PHP though?.
Luckily there is a plugin available titled Background Per Page that allows you to specify background images for individual WordPress posts or pages from a new custom settings section that is made available after installing the plugin.
Install The WordPress Background Per Page WordPress Plugin
How To Find Your WordPress Page ID
Most things in WordPress are quite easily found in the admin panel some things like the actual ID number of a page can be elusive if you have pretty permalinks enabled though. This short tutorial will show you how to easily find a WordPress page ID from the admin section of you WordPress site.
Display The Percentage Saved On WooCommerce Sale Products
At some point in time either yourself or a client will be building a WooCommerce site any may want to display the total percentage saved on WooCommerce sale products. By default WooCommerce does not display the percentage the customer will save on a sale product but thanks to Gerhard Potgieter this is easily possible by using an a elegant little WooCommerce filter.
Below is a screenshot of how a standard unmodified WooCommerce on sale product displays, You will notice it’s recommended price has a strike through and the sales price is the visible one.