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

Show or Hide widgets on specific pages

wordpress snippet

Want to show or hide widgets on specific pages? This is a great little snippet contributed by Joel Worsham that will do just that. You will first need to get the id name of the widget that you wish to define. You can do this be viewing the page source or using a web inspector tool to view the widget id. The current sample is setup to only display the core ‘pages’ widget on the contact page only. Don’t forget that is_page also accepts an array of page names and id’s.

read more

Replace widget title with custom title and HTML

wordpress snippet

Adding this snippet to the functions.php will let you use a filter to replace the widget title with custom title and or html.

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

Remove recent comments wp_head CSS

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will remove the CSS added to the header for the recent comments widget.

read more

Replace dashboard news feed with another rss feed

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will let you replace the existing RSS feed widget with another RSS feed. Change YOUR_FEED_NAME with the name you wish to display in the widget title this is located on line 09. You will need to also make adjustments to “url, title, items, show_summery, show_author, show_date” located from line 14-19.

read more

Disable widget areas on specific pages of your blog

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will disable widgets on the specified page.

read more