wordpress snippet

I have had a few projects that required me to create a page that is for template use only. I may need to add shortcode or something to the page. Now since I don’t want my client to edit this page and possibly break things I hide the pages. Adding this snippet to the functions.php of your wordpress theme will allow you to add id’s for each of the posts or pages you wish to hide.

wordpress snippet

When using query_posts to customize the query you may find that the “read more…” link no longer functions. Fixing this issue will require you to reset the $more variable. Add the following snippet just before the loop and things will start functioning properly again.

this months featured snippets

wordpress snippet

This is a selection of snippets to display counts for posts, pages, custom post types, comments. Posts and pages have a publish and draft status while comment counts include moderated, approved, spam, trash, total.

wordpress snippet

A few days ago Bob posted a comment asking about using the post views snippet to display the most popular posts. So here it is! place this snippet just before the loop within the index.php template and wordpress will use the post views to order your posts from highest to lowest. Don’t forget that for this to work you will need to setup the post views snippet.