Want to add your post’s featured image to your admin columns on WordPress? It’s straight forward, just copy the below code and paste it into your functions.php.
WordPress taxonomy terms and comments count showing zero after import
A client recently needed me to migrate a lot of posts and tags to WordPress from a different CMS.
After importing all of the tags and posts to WordPress, I noticed that If I went to the tags page, all of the tags were listed, but they were all showing as ‘0’ even though the tags were assigned to posts. This was specifically used for a custom post type and custom taxonomy.
Rename WooCommerce in WordPress admin
If you’re setting up an online shop for a client, sometimes it’s good to mask that you’re using software like WooCommerce, just so it looks like a more custom job.
Just add this to your functions.php in your theme and rename where I have “Store Settings” to what ever you want!
Custom Taxonomy Filter in WordPress Admin
I’ve just created a custom post type and custom taxonomy in WordPress.
The custom post type is “product” and the taxonomy is “metal_types“.
It’s all working well, but I want to be able to filter results based on the taxonomy in my WordPress admin page. As you have probably realised, WordPress does not natively add that functionality in, you need to do it.
Replace WordPress post date with hours and days
Today I found a really cool and simple way to change your WordPress post archive to display how long ago the post was made as opposed to the date. It gives your visitors a very fast indication that the post is new so they don’t have to think twice about today’s date.
So, basically instead of the post saying “Posted 10/10/16” – it will say, “Posted 2 hours ago”, or “Posted 2 Days ago” etc.
Inserting a pipe between two menu items
Inserting a pipe between two menu items is simple with the use of pseudo css classes. It’s better to do it this way so you don’t have to manually add the pipe items in HTML.
This way, you can also remove the pipe from the far left or right of the menu.
User must be logged in to view WooCommerce Products
Sometimes, you want a good old simple way to restrict customers who don’t have accounts to view your products on your WooCommmerce website. A reason why I’m setting this up for a client is because they have two websites. One of them is for the public, the second is for wholesale customers who need to have accounts before they can access the products. Rather than purchasing another plugin, there’s a fast way to make this work without spending a cent.
Add Bootstrap rows to the WooCommerce loop
Bootstrap is an awesome grid system and is the one of the most popular choices for web designers worldwide. Mostly because it’s such an easy system to learn.
WooCommerce is a different story, tonight I was almost ripping my hair out trying to “bootstrapify” a custom theme with WooCoommerce, and I ran into a big problem.
On the products category page, I wanted Bootstrap to spit out a row every 4 products so that they are all in line and they don’t play up if one of the product titles are larger. Three hours later after a lot of trial and error, I finally figured it out.
Remove Wootheme Updater message in WooCommerce
One of my pet hates is plugin notifications on WordPress, especially the ones you can’t remove without the click of an exit button. WooCommerce plugins tend to put a message at the top of the screen on your dashboard enticing you to install the “WooThemes updater plugin”. I can see how the plugin is useful, as it will allow you to ensure all of your WooCommerce plugins are up to date…but it’s really annoying, especially if you’re making the website for a client who will see that and wonder what it’s all about..
Fixing empty or blank searches from displaying all posts in WordPress
After creating my own WordPress theme, I needed a search page. I created “search.php” (as that is the template that WordPress recognises to display search results). After testing, I noticed if I hit the submit button without entering a search query, all of the posts on my website will display. Obviously, this isn’t good and after looking online have found a fix to show you.