[Plugin: Genesis Featured Widget Amplified] Conditional Tags
-
I’m trying to use conditional tags in the sidebar, but not having any luck getting it to work properly.
I’m using the gfwa_after_post_content hook to add in a few social sharing buttons to the posts on the homepage.
When I drop in the widget to the sidebar that hook is generating in the sidebars as well, which I don’t want. So I created a conditional tag to what I thought would remove it from the sidebar.
Here is my code:
<?php if ( !is_active_sidebar() ) {?> <div id="featured-social"> <div id="featured-twitter"> <?php do_action('stc_tweetbutton'); ?> </div><!-- end #featured-twitter --> <div id="featured-facebook"> <?php do_action('sfc_share_button'); ?> </div><!-- end #featured-facebook --> <div id="featured-linkedin"> <?php do_action('linkedin_button'); ?> </div><!-- end #featured-linkedin --> </div><!-- end #featured-social --> <?php } ?>
This is in a file called featured_social.php which I’m calling in funtions.php via:
// Add Social Buttons to Featured Widget add_action('gfwa_after_post_content', 'include_featured_social'); function include_featured_social() { require(CHILD_DIR.'/featured-social.php'); }
I just get an error when I bring it live. I tried it without the conditional tag and it works fine. Any ideas what I did wrong?
https://www.ads-software.com/extend/plugins/genesis-featured-widget-amplified/
- The topic ‘[Plugin: Genesis Featured Widget Amplified] Conditional Tags’ is closed to new replies.