echo '<meta name="twitter:image" content="' . $ogp_image . '">'; echo "\n"; } else { $ogp_image = get_stylesheet_directory_uri() . '/images/og-image.jpg'; echo '<meta name="twitter:image" content="' . $ogp_image . '">'; echo "\n"; } } //ドメイン情報を$results[1]に取得する //preg_match( '/https?:\/\/(.+?)\//i', admin_url(), $results ); //画像の縦横幅を取得 //list($width,$height) = getimagesize($img_url); ?> <meta name="twitter:domain" content="<?php echo get_this_site_domain(); ?> "> <?php if (get_twitter_follow_id()) { //TwitterIDが設定されている場合 ?> <meta name="twitter:creator" content="@<?php echo esc_html(get_twitter_follow_id()); ?> "> <meta name="twitter:site" content="@<?php echo esc_html(get_twitter_follow_id()); ?> ">
function wlw_edit_post_link($link, $before, $after) { if (is_wlw_link_visible()) { if (is_user_logged_in()) { $query = is_single() ? 'postid' : 'pageid'; echo $before . '<a href="wlw://' . get_this_site_domain() . '/?' . $query . '='; echo the_ID(); echo '">' . $link . '</a>' . $after; } } }
function url_to_external_blog_card_tag($url) { $url = strip_tags($url); //URL //サイトの内部リンクは処理しない場合 if (strpos($url, get_this_site_domain())) { return; } $tag = ''; if (is_blog_card_external_hatena()) { //取得した情報からはてなブログカードのHTMLタグを作成 $tag = '<' . 'iframe ' . 'class="blog-card external-blog-card" src="//hatenablog-parts.com/embed?url=' . $url . '"></' . 'iframe' . '>'; } elseif (is_blog_card_external_embedly()) { //取得した情報からEmbedlyブログカードのHTMLタグを作成 $tag = '<a class="embedly-card" href="' . $url . '">' . $url . '</a><script async src="//cdn.embedly.com/widgets/platform.js" charset="UTF-8"></script>'; } return $tag; }