Skip to content

Instantly share code, notes, and snippets.

@adamcbrewer
Created March 14, 2012 17:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamcbrewer/2038207 to your computer and use it in GitHub Desktop.
Save adamcbrewer/2038207 to your computer and use it in GitHub Desktop.
WP: Register New Sidebar
<?php
/**
* Location: functions.php
*/
// callback function
function your_widget_display() {
// print some HTML for the widget to display here
echo "Your Widget Test";
}
// registering the sidebar widget
wp_register_sidebar_widget(
'your_widget_1', // your unique widget id
'Your Widget', // widget name
'your_widget_display', // callback function
array( // options
'description' => 'Description of what your widget does'
)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment