Forked from braddalton/Add Widget After Posts In Custom Post Type Genesis.php
Created
November 29, 2013 17:29
-
-
Save nhatdong/7709104 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| genesis_register_sidebar( array( | |
| 'id' => 'portfolio-widget', | |
| 'name' => __( 'After Custom Post Type Widget', 'wpsites' ), | |
| 'description' => __( 'This is the after portfolio widget.', 'wpsites' ), | |
| ) ); | |
| /** | |
| * @author Brad Dalton | |
| * @example http://wp.me/p1lTu0-a8W | |
| */ | |
| add_action( 'genesis_after_post', 'after_portfolio_posts', 9 ); | |
| function after_portfolio_posts() { | |
| if( 'portfolio' == get_post_type() && is_single() && is_active_sidebar( 'portfolio-widget' ) ) { | |
| echo '<div class="portfolio-widget"><div class="wrap">'; | |
| dynamic_sidebar( 'portfolio-widget' ); | |
| echo '</div></div>'; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment