get_queried_object(); if (is_home() || is_front_page()) { $linkUrl = home_url(); } else if (is_single() || is_page()) { $linkUrl = get_permalink(); } else if (is_category()) { global $cat; $linkUrl = get_category_link($cat); } else if (is_tax()) { $linkUrl = get_term_link($wp_query->query_vars['term'],$wp_query->query_vars['taxonomy']); } else { $linkUrl = (empty($_SERVER["HTTPS"]) ? "http://" : "https://") . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]; } $bizVektorOGP = ''."\n"; $bizVektorOGP .= ''."\n"; $bizVektorOGP .= ''."\n"; if (isset($options['fbAppId'])){ $bizVektorOGP = $bizVektorOGP.''."\n"; } if (is_front_page() || is_home()) { $bizVektorOGP .= ''."\n"; if (isset($options['ogpImage'])){ $bizVektorOGP .= ''."\n"; } $bizVektorOGP .= ''."\n"; $bizVektorOGP .= ''."\n"; } else if (is_category() || is_archive()) { $bizVektorOGP .= ''."\n"; if ($options['ogpImage']){ $bizVektorOGP .= ''."\n"; } } else if (is_page() || is_single()) { $bizVektorOGP .= ''."\n"; // image if (has_post_thumbnail()) { $image_id = get_post_thumbnail_id(); $image_url = wp_get_attachment_image_src($image_id,'large', true); $bizVektorOGP .= ''."\n"; } else if ( isset($options['ogpImage']) && $options['ogpImage'] ) { $bizVektorOGP .= ''."\n"; } // description $metaExcerpt = $post->post_excerpt; if ($metaExcerpt) { $metadescription = $post->post_excerpt; } else { $metadescription = mb_substr( strip_tags($post->post_content), 0, 240 ); // kill tags and trim 240 chara $metadescription = str_replace(array("\r\n","\r","\n"), ' ', $metadescription); } if( empty($metadescription) ) $metadescription = getHeadDescription(); $bizVektorOGP .= ''."\n"; $bizVektorOGP .= ''."\n"; } else { $bizVektorOGP .= ''."\n"; if ($options['ogpImage']){ $bizVektorOGP .= ''."\n"; } } $bizVektorOGP .= ''."\n"; if ( isset($options['ogpTagDisplay']) && $options['ogpTagDisplay'] == 'ogp_off' ) { $bizVektorOGP = ''; } $bizVektorOGP = apply_filters('bizVektorOGPCustom', $bizVektorOGP ); echo $bizVektorOGP; //} // function_exist } // Add BizVektor SNS module style add_action('wp_enqueue_scripts','bizVektorAddSnsStyle'); function bizVektorAddSnsStyle(){ wp_enqueue_style('Biz_Vektor_plugin_sns_style', get_template_directory_uri().'/plugins/sns/style_bizvektor_sns.css', array('Biz_Vektor_Design_style'), false, 'all'); } /*-------------------------------------------*/ /* Add twitter card /*-------------------------------------------*/ add_action('wp_head', 'biz_vektor_twitter_card' ); function biz_vektor_twitter_card() { get_template_part('plugins/sns/module_twitter_card'); } /*-------------------------------------------*/ /* snsBtns /*-------------------------------------------*/ add_action('biz_vektor_fbComments', 'biz_vektor_fbComments'); function twitterID() { $biz_vektor_options = biz_vektor_get_theme_options(); return $biz_vektor_options['twitter']; } /*-------------------------------------------*/ /* snsBtns _ display page /*-------------------------------------------*/ add_action('biz_vektor_snsBtns', 'biz_vektor_snsBtns'); function biz_vektor_snsBtns() { $biz_vektor_options = biz_vektor_get_theme_options(); $options = $biz_vektor_options; $snsBtnsFront = ( isset($options['snsBtnsFront']) ) ? $options['snsBtnsFront'] : ''; $snsBtnsPage = ( isset($options['snsBtnsPage']) ) ? $options['snsBtnsPage'] : ''; $snsBtnsPost = ( isset($options['snsBtnsPost']) ) ? $options['snsBtnsPost'] : ''; $snsBtnsInfo = ( isset($options['snsBtnsInfo']) ) ? $options['snsBtnsInfo'] : ''; $snsBtnsHidden = ( isset($options['snsBtnsHidden']) ) ? $options['snsBtnsHidden'] : ''; global $wp_query; $post = $wp_query->get_queried_object(); $snsHiddenFlag = false; // $snsBtnsHidden divide "," and insert to $snsHiddens by array $snsHiddens = explode(",",$snsBtnsHidden); foreach( $snsHiddens as $snsHidden ){ if (get_the_ID() == $snsHidden) { $snsHiddenFlag = true ; } } wp_reset_query(); if (!$snsHiddenFlag) { if ( ( is_front_page() && $snsBtnsFront ) || ( is_page() && $snsBtnsPage && !is_front_page() ) || ( get_post_type() == 'info' && $snsBtnsInfo ) || ( get_post_type() == 'post' && $snsBtnsPost ) ) { get_template_part('plugins/sns/module_snsBtns'); } } } /*-------------------------------------------*/ /* facebook comment display page /*-------------------------------------------*/ add_action('biz_vektor_fbComments', 'biz_vektor_fbComments'); function biz_vektor_fbComments() { $options = biz_vektor_get_theme_options(); global $wp_query; $post = $wp_query->get_queried_object(); $fbCommentHiddenFlag = false ; // is stored as an array to $snsHiddens to split with "," $snsBtnsHidden $fbCommentHiddens = ( isset($options['fbCommentsHidden']) ) ? explode(",",$options['fbCommentsHidden']) : ''; if ($fbCommentHiddens) : foreach( $fbCommentHiddens as $fbCommentHidden ){ if (get_the_ID() == $fbCommentHidden) { $fbCommentHiddenFlag = true ; } } endif; // wp_reset_query(); if (!$fbCommentHiddenFlag) { if ( ( is_front_page() && isset($options['fbCommentsFront']) && $options['fbCommentsFront'] ) || ( is_page() && isset($options['fbCommentsPage']) && $options['fbCommentsPage'] && !is_front_page() ) || ( get_post_type() == 'info' && isset($options['fbCommentsInfo']) && $options['fbCommentsInfo']) || ( get_post_type() == 'post' && isset($options['fbCommentsPost']) && $options['fbCommentsPost']) ) { ?>
.'/images/bnr_facebook.png)
.'/images/bnr_twitter.png)
| the URL.', 'biz-vektor'); ?> https://www.facebook.com/FacebookJapan |
|
|
[ » ] |
|
@ '.__('widget', 'biz-vektor').''; printf(__('* If you prefer to use Twitter widgets etc, this can be left blank, paste the source code into a [text] %s here.', 'biz-vektor'),$twitter_widget); ?> |
|
http://www.vektor-inc.co.jp/images/ogpImage.png |
|
|
ge you do not wish to display, enter the Page ID. If multiple pages, please separate by commas.', 'biz-vektor'); ?> |
|
|
|
|
| facebook LikeBox |
|
|
|
|
|
* |