wordpress snippets last updated   : July 14, 2014
we now have 634 snippets

Create page on theme activation

wordpress snippet

If you are creating a new theme either for sale of for a client you may want to have it create a custom page or pages when the theme is activated. Adding this snippet to the functions.php of your theme will do just that.

read more

Change admin post/page color by status – draft, pending, published, future, private

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will change the background colors of the post / page within the admin based on the current status. Draft, Pending, Published, Future, Private.

read more

Dynamically create and attach sidebars to pages or posts

wordpress snippet

This is a bit large for the snippets I normally post however very useful. This snippet will let you easily create new sidebars by simply adding the name to an array. You will also be able to define the dynamically created sidebar a page loads by selecting from the custom sidebar selection metabox.

read more

Add custom field automatically when post or page is publish

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will add a custom field to a post or page when published. Don’t forget to update the FIELD_NAME and the CUSTOM VALUE.

read more

Exclude pages from admin edit pages list

wordpress snippet

This is a great little snippet that will exclude pages based on the the ID from the admin pages list. Just add this snippet to the functions.php of your wordpress theme and update the array with the page ID’s you wish to hide. Please note this does not stop a post from being editable this snippet only hides the page from view.

read more

Use gettext, ngetext to replace array of words in wp admin

wordpress snippet

Simple but useful method using gettext, ngetext filter to replace an entire array of words within the wordpress admin. Just update the array key with the item you wish to replace and the array value with the text to replace it with. Add this snippet to the functions.php of your wordpress theme.

read more
jqsnipp.com | we just launched jquery snippets website