Skip to content

Instantly share code, notes, and snippets.

@wpweb101
Last active August 29, 2015 14:19
Show Gist options
  • Select an option

  • Save wpweb101/3451b2f1504052b99512 to your computer and use it in GitHub Desktop.

Select an option

Save wpweb101/3451b2f1504052b99512 to your computer and use it in GitHub Desktop.
Follow my blog post - Add author follow button on frontend submission vendor shop page in maketify theme
<?php
// add action to add author follow button
add_action( 'marketify_vendor_profile_after_sales', 'wpw_fp_author_follow_button' );
function wpw_fp_author_follow_button() {
$author_slug = get_query_var( 'vendor' );
$author_detail = get_user_by( 'slug', $author_slug );
$author = '';
if( $author_detail ) {
//Get author ID if exist
$author = isset( $author_detail->ID ) ? $author_detail->ID : '';
}
if( !empty( $author ) ) {//check if author not empty
// check for plugin using plugin name
if ( is_plugin_active( 'follow-my-blog-post/follow-my-blog-post.php' ) ) { ?>
<div class="download-author-sales">
<?php echo do_shortcode('[wpw_follow_author_me author_id="'.$author.'"][/wpw_follow_author_me]'); ?>
</div><?php
}
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment