Last active
December 11, 2015 08:38
-
-
Save ahaywood/4574672 to your computer and use it in GitHub Desktop.
PHP: WP - Create widget section
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
// ADD TO FUNCTIONS.PHP | |
if (function_exists('register_sidebar')) { | |
register_sidebar(array( | |
'before_widget' => '', | |
'after_widget' => '', | |
'before_title' => '<h5>', | |
'after_title' => '<h5>', | |
)) | |
} | |
// ADD TO ACTUAL FILE | |
<?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar()) : ?> | |
<!-- ONLY SHOWS IF THERE IS NOTHING IN THE WIDGET AREA --> | |
<?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment