Code Assistance
-
Hello Tom/Leo. I have this custom social share plugin which is hooked inside content by the plugin author and was showing its HTML content in the beginning and end of schema content. I had to choose the manual placement and hook it like below to show before content and after content. However, I was wondering if you have a better idea of a code to open and close the ‘before and after entry content’ loop other than what I am doing below. Thank you.
// social sharing buttons before the content add_action( 'generate_before_content', 'as_custom_share_buttons'); function as_custom_share_buttons() { if (is_single() ) { ?> <?php echo do_shortcode('[share_buttons]'); ?> <?php } } // social sharing buttons after content add_action( 'generate_after_content', 'as_custom_share_button'); function as_custom_share_button() { if (is_single() ) { ?> <?php echo do_shortcode('[share_buttons]'); ?> <?php } }
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Code Assistance’ is closed to new replies.