Last active
February 19, 2016 20:18
-
-
Save jsonberry/fdf19ff945487af638c2 to your computer and use it in GitHub Desktop.
WordPress -> Custom Widget Function. Add to functions.php.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function create_widget($name, $id, $description) | |
{ | |
register_sidebar(array( | |
'name' => __( $name ), | |
'id' => $id, | |
'description' => __( $description ), | |
'before_widget' => '<div id="'.$id.'" class="widget %1$s %2$s">', | |
'after_widget' => '</div>', | |
'before_title' => '<h3>', | |
'after_title' => '</h3>' | |
)); | |
} | |
create_widget("Header", "uptop", "Displays in the header of the site, above the title"); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment