Yearly Archives: 2014

Character limit

The following function will create a custom function to create a unique character limit excerpt for the post. Add the following to functions.php:

Add the following to the page template to get the function to show:

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: