Monthly Archives: October 2014

Show only if there are comments

The following snippet will allow you to show content only if a comment exists for the current post or page.

Limit Post Title Length

Here is how to limit the post title length.

Replace your post title with the snippet above.

Get Custom Post Type Posts

The following code will display the posts from a specific custom post type.

Advanced Custom Fields if Statement

This will show the content enclosed in the if statement only if the custom field exists.

Change Number of Search Results

To change the number of search results listed add the following snippet right above the if(have_posts) statement.  

So it would look like this:

Limit Search Results to Blog Posts Only

The following snippet will limit search results to display blog posts only on your search results page. Copy and paste the following into functions.php