Quantcast
Channel: SIMPLESNIPS.COM
Browsing all 55 articles
Browse latest View live

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 Article



Featured 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 Article

List 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 Article

Get 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 Article

Change 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 Article


Check 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 Article

Show 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 Article

Get 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 Article


Filter 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 Article


Fix 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 Article

Page 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 Article

Remove 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 Article

Delete 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 Article


Prevent 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 Article

Advanced 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 Article


Show 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 Article

PHP 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 Article


Adding 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 Article

Get 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 Article

Adding 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
Browsing all 55 articles
Browse latest View live




Latest Images