Created
April 1, 2019 11:25
-
-
Save damiencarbery/7ccedff1fd8ccf1aa042fa3d876b7a55 to your computer and use it in GitHub Desktop.
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 | |
/* | |
Plugin Name: Extra Widget Areas (Essence Pro) | |
Plugin URI: https://damiencarbery.com/ | |
Description: Add some extra widget areas to Essence Pro's front page. | |
Author: Damien Carbery | |
Version: 0.1 | |
*/ | |
add_action( 'widgets_init', 'ep_extra_widget_areas' ); | |
function ep_extra_widget_areas() { | |
genesis_register_sidebar( | |
array( | |
'id' => 'front-page-3', | |
'name' => __( 'Front Page 3', 'essence-pro' ), | |
'description' => __( 'This is the front page 3 section.', 'essence-pro' ), | |
) | |
); | |
genesis_register_sidebar( | |
array( | |
'id' => 'front-page-4', | |
'name' => __( 'Front Page 4', 'essence-pro' ), | |
'description' => __( 'This is the front page 4 section.', 'essence-pro' ), | |
) | |
); | |
} | |
add_action( 'genesis_loop', 'ep_extra_front_page_widgets', 40 ); | |
function ep_extra_front_page_widgets() { | |
if ( is_active_sidebar( 'front-page-3' ) ) { | |
essence_do_widget( 'front-page-3' ); | |
} | |
if ( is_active_sidebar( 'front-page-4' ) ) { | |
essence_do_widget( 'front-page-4' ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment