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

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

Disable sidebar widgets on specific posts

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will let you disable widgets on specific posts by updating the array on line 3 with post ID’s. Please note that this is a comma separated list of ID’s.

read more

Custom sidebar for home page

wordpress snippet

Replacing the default get_sidebar() with this snippet to load a custom sidebar just for the home page. Be sure to name your new sidebar document sidebar-home.php.

read more

Is sidebar widget active

wordpress snippet

Adding this PHP code to the sidebar.php for your wordpress theme will let you check if a sidebar widget is active if not display something else.

read more

Disable widgets on specific pages by user level

wordpress snippet

Adding this php code to your functions.php will disable widgets on the home page only, without completely disabling widgets. You could change is_home() to is_page() or specific pages.

read more

Add wordpress login to sidebar

wordpress snippet

Adding this PHP code to the sidebar of your wordpress theme will allow your visitors to register and login from your sidebar.

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