Get First Paragraph

Stolen from https://gist.github.com/banago …

I often need to get just the first piece of a WordPress post to use for the excerpt…it is apparently not ok to expect the client to copy and paste text into the excerpt field.

 

Add Meta Box to Post

I had to add a small meta box to a custom post type so the user could be directed to the correct page easily to generate the html for an html email campaign.

 

Woocommerce Edit Query

This was my first Woocommerce project and it was rough getting everything working as expected. This bit of code helped me narrow the query results for Woocommerce. Place in functions.php

 

Register Custom Post Types

I was sick of repeating myself when making CPTs. This is a pretty simple function that makes it easier.

Now this is obviously not a “One Size Fits All” Solution but I find it helpful as a starting point.

Query Custom Post Types

Query WordPress for a particular post type.

If you just want an object and not the entire post loop you can also do this.