Block Referral Spam like Semalt
The following snippet added to your htaccess file will block referral spam from accessing your site. [crayon-56a36ac66f5e4566446528/] The post Block Referral Spam like Semalt appeared first on...
View ArticleFeatured Image URL
The following snippet will give you just the url for the featured image without wrapping it in any tags. [crayon-56a36ac66f3ee909074558/] Code credit to:...
View ArticleList Custom Post Type Categories
The following will list the categories of a custom post type. [crayon-56a36ac66f208973693338/] Code Credit to: http://www.paulund.co.uk/display-categories-of-a-custom-post-type The post List Custom...
View ArticleGet Category of Current Custom Post Type
The following will list the categories of the current post type. [crayon-56a36ac66efcb018045390/] If you want to exclude one of the categories so it does not show add this:...
View ArticleChange the Number of Related Products in Woocommerce
The following bit of code will change the number of related products that are displayed on a Woocommerce single product page. Add this to your functions.php file. [crayon-56a36ac66ed3a397204781/] The...
View ArticleCheck if the Post has Certain Number of Image Attachments
The following snippet of code will check to see if your post or custom post type has any attachments and then allows you to use an if else statement. You can change the number of attachments to check...
View ArticleShow Featured Image Excerpt
The following bit of code will get the caption for a featured image. [crayon-56a36ac66e929541225473/] The post Show Featured Image Excerpt appeared first on SIMPLESNIPS.COM.
View ArticleGet the Posts of a Specific Category
The following snippet will get the posts of a specific category. So if you wanted to have a page that just shows posts of a certain category this would do it . [crayon-56a36ac66e721081622824/] In this...
View ArticleFilter Custom Post Types By Category (Taxonomy)
I was trying to find a way to filter my custom post types by category in the admin view and was having difficulty learning how to do it. After a ton of searching I found a great snippet of code to...
View ArticleFix http and Thumbnail Error on Image Upload
A client was having issues with her image uploads http error and thumbnails not generating. Smaller images would generate the thumbnail just fine however larger images would upload but fail to generate...
View ArticlePage Fade in Script
The following snippet of code will make the page fade in on reload. Put in between the head tags. Change the number “2000” to adjust the speed at which it fades in. [crayon-56bb1f070df3f733928802/] The...
View ArticleRemove Items from Admin Sidebar
Want to remove items from the admin sidebar to tidy things up? Here is how to do that: [crayon-56cf0412471d2979930848/] Original post found:...
View ArticleDelete WordPress Attachments when Deleting Post
I was trying to find a way to delete the media files attached to all WordPress posts when deleting a bunch of posts at once. I did not want to leave behind a bunch of media files once I got rid of the...
View ArticlePrevent WordPress From Updating
While strongly discouraged, sometimes you need to prevent WordPress from automatically updating or from updating entirely. To accomplish this you just need to add two lines of code to your...
View ArticleAdvanced Custom Fields Get Select Label
Here is how to get the select label in an advanced custom fields output. [crayon-570291fad42f5072579340/] Change “Type” to the field name and you are good to go. The post Advanced Custom Fields Get...
View ArticleShow the Current Version of PHP
The following snippet will output the current version of php that your server is running. [crayon-572b9767f1de2810887961/] The post Show the Current Version of PHP appeared first on SIMPLESNIPS.COM.
View ArticlePHP hide content before or after a certain date
The following snippet will prevent the content from showing before or after a certain date. [crayon-5754aa435825e841718162/] The post PHP hide content before or after a certain date appeared first on...
View ArticleAdding Jquery Code to WordPress
For this example we are going to use a script from a sticky menu First, add your script to a .js file located in your theme and make sure you wrap the code with the first and last lines:...
View ArticleGet PHP Information
This snippet will output the PHP info for your hosting environment. You would want to add this to a php file like php-info.php and put it in your root folder of the site. This will show all sorts of...
View ArticleAdding a Basic Slider to your Theme or Site
Flex Slider is an awesome and super basic image slider that you can add to your theme to make it easy for clients to add a slider to their webpages. This slider is well documented and because of that...
View Article