function vkExUnit_add_follow($content) { $postType = vkExUnit_get_post_type(); if (is_single() && $postType['slug'] == 'post') { $options = vkExUnit_get_sns_options(); if (!$options['enableFollowMe']) { return $content; } if (isset($options['followMe_title']) && $options['followMe_title']) { $title = $options['followMe_title']; } else { $title = __('Follow me', 'vkExUnit') . '!'; } // https://about.twitter.com/resources/buttons#follow $follow_html = ''; $fbPageUrl = isset($options['fbPageUrl']) ? $options['fbPageUrl'] : ''; $twitterId = isset($options['twitterId']) ? $options['twitterId'] : ''; $follow_html .= '<div class="veu_followSet veu_contentAddSection">' . "\n"; $follow_html .= '<h3 class="followSet_title">' . $title . '</h3>'; if ($fbPageUrl) { $follow_html .= '<div class="follow_btn fb-like" data-href="' . esc_url($options['fbPageUrl']) . '" data-layout="button" data-action="like" data-show-faces="false" data-share="true"></div>' . "\n"; } if ($twitterId) { $follow_html .= '<div class="follow_btn follow_twitter"><a href="https://twitter.com/' . esc_html($options['twitterId']) . '" class="twitter-follow-button" data-show-count="false" data-lang="ja" data-show-screen-name="false">@' . esc_html($options['twitterId']) . '</a></div>' . "\n"; } $follow_html .= '<div class="follow_btn follow_feedly"><a href="http://cloud.feedly.com/#subscription/feed/' . home_url() . '/feed/" target="blank"><img id="feedlyFollow" src="http://s3.feedly.com/img/follows/feedly-follow-rectangle-volume-small_2x.png" alt="follow us in feedly" width="66" height="20"></a></div>' . "\n"; $follow_html .= '</div><!-- [ /.followSet ] -->' . "\n"; $content .= $follow_html; } // if ( $postType == 'post' && is_single() ) : return $content; }
function exUnit_print_fbId_script() { ?> <div id="fb-root"></div> <?php $options = vkExUnit_get_sns_options(); $fbAppId = isset($options['fbAppId']) ? $options['fbAppId'] : ''; ?> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/ja_JP/sdk.js#xfbml=1&version=v2.3&appId=<?php echo esc_html($fbAppId); ?> "; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> <?php //endif; }
<h3><?php echo __('SNS Settings'); ?> </h3> <?php $options = vkExUnit_get_sns_options(); /*-------------------------------------------*/ /* SNS /*-------------------------------------------*/ ?> <div id="snsSetting" class="sectionBox"> <!-- OGP hidden --> <table class="form-table"> <tr> <th><?php _e('facebook application ID', 'vkExUnit'); ?> </th> <td><input type="text" name="vkExUnit_sns_options[fbAppId]" id="fbAppId" value="<?php echo esc_attr($options['fbAppId']); ?> " /><br /> <span>[ <a href="https://developers.facebook.com/apps" target="_blank">» <?php _e('I will check and get the application ID', 'vkExUnit'); ?> </a> ]</span><br /> <?php _e('* If an application ID is not specified, neither a Like button nor the comment field displays and operates correctly.', 'vkExUnit'); ?> <br />