wordpress snippets last updated   : October 6, 2014
we now have 641 snippets

Force custom post type to be private

wordpress snippet

Adding this PHP snippet to the functions.php of your wordpress theme will force your custom post type to be private by default. Do not forget to change my_post_type to the name of your custom post type. This is a slight change from the source snippet and does not include a password since this is private and not password protected.

read more

Private posts for logged in users

wordpress snippet

Using this as your wordpress loop will display posts with the custom field of private only to users that are logged into your website.

read more

Member only content

wordpress snippet

Adding this PHP code to the functions.php file of your wordpress theme will allow you to place content you only wish members to see within the members short code [member][/member].

read more

Remove private and Protected

wordpress snippet

Adding this PHP code to the functions.php of your wordpress theme will remove the private and protected text that will displayed with password protected posts.

read more