I need to add some styles that only take effect in the WordPress Admin area, to do it, add this to functions.php
add_action('admin_head', 'my_custom_styles'); function my_custom_styles() { echo '<style> // Add styles here </style>'; }
I need to add some styles that only take effect in the WordPress Admin area, to do it, add this to functions.php
add_action('admin_head', 'my_custom_styles'); function my_custom_styles() { echo '<style> // Add styles here </style>'; }
On a project I’m doing, I created a custom post type for a catalogue and want the featured image to display on the admin table.
My custom post type is called “product” and I want to limit the feature to only the “product” custom post type. Here’s how I did it.
I added this into functions.php
Sometimes you might want to programatically include other things in your menu in WordPress and to do that you will want to control the UL tags so you can insert other LI items within it.
The code below will allow you to spit out ONLY the LI tags from a WordPress Nav Menu, you will have to wrap it in UL yourself so you can add extra LI.
The default WordPress excerpt character length can be changed by inserting the below snippet into your functions.php.
Change 20 to however many characters you want to limit your excerpt to.
Read More
I needed to delete all custom titles and descriptions fast from Yoast plugin for WordPress.
To do it, I used these SQL queries in MySQL
When you need to restrict users in WordPress, there are heaps of plugins you can download. Personally, I think too many plugins is a bad practice in WordPress, it can lead to “plugin bloat”, where your website can be slowed down and you’re reliant on too many plugins to make your site work.
In the video below, you will see how I manage user restrictions quite easily using a must use plugin in WordPress and a few minutes of my time.
Have you set up custom taxonomies in WordPress and want to display all of the terms that a post has on it’s single page? No problems, paste the below code into your template. Read More
Want to show a link to log out only if a user is logged in and vice versa?
Try the below code, paste it directly into your template on WordPress.
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.
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.
Read More