SSLサイトでの外部ブログカード対応

Simplicityの特徴 フォーラム 不具合報告 SSLサイトでの外部ブログカード対応

3件の返信スレッドを表示中
  • 投稿者
    投稿
    • #32783 返信
      keimaspace
      ゲスト

      SSLサイトでは外部ブログカードの表示ができないのですが、APIエンドポイントを変更することで対応できましたのでご報告します。
      変更前:

      //hatenablog.com/embed?url=
      変更後:

      //hatenablog-parts.com/embed?url=
      hatenablog.comでリクエストするとhatenablog-parts.comにリダイレクトされて表示されるので、hatenablog-parts.comが現在のAPIエンドポイントのようです――しかしドキュメントが見つからず、裏は取れていません。
      よろしければマージお願いします。

      diff --git a/wp-content/themes/simplicity/functions.php b/wp-content/themes/simplicity/functions.php
      index 4f5d537..d1447fd 100644
      --- a/wp-content/themes/simplicity/functions.php
      +++ b/wp-content/themes/simplicity/functions.php
      @@ -565,7 +565,7 @@ function url_to_hatena_blog_card_tag($url){
         }
       
         //取得した情報からブログカードのHTMLタグを作成
      -  return '<'.'iframe '.'class="blog-card external-blog-card" src="//hatenablog.com/embed?url='.$url.'"></'.'iframe'.'>';
      +  return '<'.'iframe '.'class="blog-card external-blog-card" src="//hatenablog-parts.com/embed?url='.$url.'"></'.'iframe'.'>';
       }
       endif;
       
      @@ -589,7 +589,7 @@ function url_to_hatena_blog_card($the_content) {
             // }
       
             // //取得した情報からブログカードのHTMLタグを作成
      -      // $tag = '<'.'iframe '.'class="blog-card external-blog-card" src="//hatenablog.com/embed?url='.$url.'"></'.'iframe'.'>';
      +      // $tag = '<'.'iframe '.'class="blog-card external-blog-card" src="//hatenablog-parts.com/embed?url='.$url.'"></'.'iframe'.'>';
       
             //本文中のURLをブログカードタグで置換
             $the_content = preg_replace('{'.preg_quote($match).'}', $tag , $the_content, 1);
      
    • #32786 返信
      keimaspace
      ゲスト

      ああ、すみません、コード差分がバージョン1.8.1のものです。整理後のfunction.phpだと別の場所に移動していそうです。

    • #32799 返信
      Ozk
      ゲスト

      同じくSSL化で表示できなくなって困ってました。
      解決方法のご教示ありがとうございます。

    • #32813 返信
      アバター画像わいひら
      キーマスター

      修正方法ありがとうございます。
      手元のファイルを修正しておいたので、次のバージョンで改善されると思います。

3件の返信スレッドを表示中
返信先: SSLサイトでの外部ブログカード対応
あなたの情報:




スポンサーリンク
アドセンス(大)
アドセンス(大)