<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>WordPress &#8211; M. Yamaguchi Laboratory</title>
	<atom:link href="https://ba.sozo.ac.jp/myama/home/archives/tag/wordpress/feed" rel="self" type="application/rss+xml" />
	<link>https://ba.sozo.ac.jp/myama/home</link>
	<description>豊橋創造大学　経営学部　経営学科　山口満研究室</description>
	<lastBuildDate>Mon, 15 Jan 2024 05:24:02 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.6.1</generator>
	<item>
		<title>Huemanテーマの印刷スタイルを書く</title>
		<link>https://ba.sozo.ac.jp/myama/home/archives/1983</link>
					<comments>https://ba.sozo.ac.jp/myama/home/archives/1983#respond</comments>
		
		<dc:creator><![CDATA[山口]]></dc:creator>
		<pubDate>Wed, 27 May 2015 05:14:54 +0000</pubDate>
				<category><![CDATA[開発・サービス]]></category>
		<category><![CDATA[雑記]]></category>
		<category><![CDATA[WordPress]]></category>
		<guid isPermaLink="false">http://ba.sozo.ac.jp/myama/home/?p=1983</guid>

					<description><![CDATA[WordPress のテーマ Hueman はなかなか素敵．しかし印刷用のスタイルが定義されておらず，ページを印刷しようとしたらえらいことになる（本家サイトも対応していないし）．Web で調べてみても&#46;&#46;&#46;]]></description>
										<content:encoded><![CDATA[<p>WordPress のテーマ Hueman はなかなか素敵．しかし印刷用のスタイルが定義されておらず，ページを印刷しようとしたらえらいことになる（本家サイトも対応していないし）．Web で調べてみても，大して情報が出てこない．同じように困っている人がいることは確認．このテーマはそこそこ利用者が多い様子だけど，みんなこそっとカスタマイズして使ってるのかしら．</p>
<p>とりあえずページを印刷できないといろいろ困るので，スタイルを追加して最低限の情報をプリントできるようにする．参考までに</p>
<div class="myclass">
<blockquote><p>
Hueman<br />
<a href="http://alxmedia.se/themes/hueman/" target="_blank">http://alxmedia.se/themes/hueman/</a>
</p></blockquote>
</div>
<hr>
<h2>症状</h2>
<div class="myclass">
<ul>
<li>Hueman なサイトで記事（ページ）を印刷しようとすると，サイドバーの幅の影響で本文が表示されない．表示されたとしても，コンテンツ領域の幅が細く縦長に表示されてしまう．印刷できる状態でない．</li>
</ul>
</div>
<h2>目的</h2>
<div class="myclass">
<ul>
<li>Hueman なサイトでちゃんと記事（ページ）をしっかり印刷できるようにする</li>
</ul>
</div>
<h2>目標</h2>
<div class="myclass">
<ul>
<li>個別記事（ページ）の本文を印刷できるようにする</li>
<li>サイドバーやメニュー，ナビゲーション，関連記事等は印刷対象としない</li>
</ul>
</div>
<h2>環境</h2>
<div class="myclass">
<ul>
<li>WordPress 4.2.2-ja</li>
<li>Hueman 2.2.3</li>
<li>子テーマ（Hueman-Child）を作成してサイトデザイン・運営</li>
<li>Layout は 3 Column Middle（左サイドにPrimary，中央はメインコンテンツ，右サイドにSecondary）</li>
</ul>
<p>子テーマの style.css に印刷用の media query を定義し，元スタイルを上書きしていい感じに印刷できるようにする．子テーマを使わずに運用している人は，custom.css を有効にして追記すればよいかと
</p></div>
<hr>
<h2>何がいけないのか調べてみる</h2>
<div class="myclass">
Chrome のデベロッパーツールで見てみる．<br />
サイドバーの .s1 と .s2 クラスなオブジェクトのスタイルを単純に display:none; にすればできそう・・・だけど，印刷プレビューするとサイドバー分の空間が残ったまま（改善せず）．</p>
<p>原因は div の main-inner クラス要素の padding が効いてるからっぽい．</p>
<p><a href="https://ba.sozo.ac.jp/myama/home/wp-content/uploads/2015/01/huemantheme1.png" data-rel="lightbox-image-0" data-rl_title="" data-rl_caption="" title=""><img fetchpriority="high" decoding="async" src="https://ba.sozo.ac.jp/myama/home/wp-content/uploads/2015/01/huemantheme1-300x205.png" alt="main-inner" width="300" height="205" class="aligncenter size-medium wp-image-1996" srcset="https://ba.sozo.ac.jp/myama/home/wp-content/uploads/2015/01/huemantheme1-300x205.png 300w, https://ba.sozo.ac.jp/myama/home/wp-content/uploads/2015/01/huemantheme1.png 578w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>具体的には，.col-3cm（3カラム設定でコンテンツ中央のときに適用されるクラス）の下の .main-inner（画像参照）．<br />
<a href="https://ba.sozo.ac.jp/myama/home/wp-content/uploads/2015/01/huemantheme2.png" data-rel="lightbox-image-1" data-rl_title="" data-rl_caption="" title=""><img decoding="async" src="https://ba.sozo.ac.jp/myama/home/wp-content/uploads/2015/01/huemantheme2-217x300.png" alt=".col-3cm 下の .main-inner に padding" width="217" height="300" class="aligncenter size-medium wp-image-1995" srcset="https://ba.sozo.ac.jp/myama/home/wp-content/uploads/2015/01/huemantheme2-217x300.png 217w, https://ba.sozo.ac.jp/myama/home/wp-content/uploads/2015/01/huemantheme2.png 224w" sizes="(max-width: 217px) 100vw, 217px" /></a></p>
<p>style.css の該当箇所を表示してみる．<br />
<a href="https://ba.sozo.ac.jp/myama/home/wp-content/uploads/2015/01/huemantheme3.png" data-rel="lightbox-image-2" data-rl_title="" data-rl_caption="" title=""><img decoding="async" src="https://ba.sozo.ac.jp/myama/home/wp-content/uploads/2015/01/huemantheme3-300x120.png" alt="style.css の該当箇所" width="300" height="120" class="aligncenter size-medium wp-image-1994" srcset="https://ba.sozo.ac.jp/myama/home/wp-content/uploads/2015/01/huemantheme3-300x120.png 300w, https://ba.sozo.ac.jp/myama/home/wp-content/uploads/2015/01/huemantheme3.png 878w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>ということで，その padding 指定部分を print 時に 0 になるようにする．
</p></div>
<hr>
<h2>style.css にメディアクエリ print の記述を追加</h2>
<div class="myclass">
次のように style.css に追記．</p>
<pre class="trim-whitespace:false lang:css decode:true " >@media print {
/* ページ幅を適当に決めるとよいと思う．auto でもよい人はそうしたほうが */
body { width:960px; }

/* 印刷に含めないものたち */
#nav-topbar,
#nav-header,
#nav-footer,
#footer-widgets,
#comments,
.sidebar,
.post-nav,
.content h4.heading,
.related-posts,
.s1, .s2 { display: none !important; }

/* main 領域の幅をフルに，main-inner の余計な padding や margin を除く */
.col-3cm .main { background: none repeat-y right 0; width:100%; }
.col-3cm .main-inner { background: none repeat-y left 0; padding: 0px; margin:0px; }
}</pre>
</div>
<hr>
<h2>結果</h2>
<div class="myclass">
<ul>
<li>とりあえずは記事本文を印刷できるようになった</li>
<li>画像の大きさが気になる・・・けどとりあえずはOKとする</li>
<li>3 Column Middle（col-3cm）じゃない人は，他の Layout のクラスで同じようにすればできるだろうと予想（試してはいない）</li>
<li>誰かうまいこと print.css を作って</li>
<li>何かあればコメント欄にどうぞ</li>
</ul>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://ba.sozo.ac.jp/myama/home/archives/1983/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>WordPress 4.2～ 絵文字（画像）を無効にする</title>
		<link>https://ba.sozo.ac.jp/myama/home/archives/1952</link>
		
		<dc:creator><![CDATA[山口]]></dc:creator>
		<pubDate>Fri, 22 May 2015 01:54:53 +0000</pubDate>
				<category><![CDATA[雑記]]></category>
		<category><![CDATA[WordPress]]></category>
		<guid isPermaLink="false">http://ba.sozo.ac.jp/myama/home/?p=1952</guid>

					<description><![CDATA[WordPress 4.2から，記号などが勝手に絵文字（画像）に置き換わる現象が発生する．理由は「マルチバイト文字対応と絵文字の対応」をしたから，だそう．とりあえずメモ． 9ineBB &#8211;&#46;&#46;&#46;]]></description>
										<content:encoded><![CDATA[<p>WordPress 4.2から，記号などが勝手に絵文字（画像）に置き換わる現象が発生する．理由は「マルチバイト文字対応と絵文字の対応」をしたから，だそう．とりあえずメモ．</p>
<div class="myclass">
<blockquote><p>
9ineBB &#8211; WordPress 4.2 から絵文字を無効に(元に戻す)プラグイン「Disable Emojis」<br />
<a href="http://9-bb.com/wordpress-emoji/" target="_blank">http://9-bb.com/wordpress-emoji/</a>
</p></blockquote>
</div>
<hr>
<h2>絵文字有効の場合の表示</h2>
<div class="myclass">
<div id="attachment_1951" style="width: 310px" class="wp-caption aligncenter"><a href="https://ba.sozo.ac.jp/myama/home/wp-content/uploads/2015/01/emoji-enabled.png" data-rel="lightbox-image-0" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1951" src="https://ba.sozo.ac.jp/myama/home/wp-content/uploads/2015/01/emoji-enabled-300x216.png" alt="絵文字有効" width="300" height="216" class="size-medium wp-image-1951" srcset="https://ba.sozo.ac.jp/myama/home/wp-content/uploads/2015/01/emoji-enabled-300x216.png 300w, https://ba.sozo.ac.jp/myama/home/wp-content/uploads/2015/01/emoji-enabled.png 819w" sizes="(max-width: 300px) 100vw, 300px" /></a><p id="caption-attachment-1951" class="wp-caption-text">絵文字有効</p></div></p>
<p>ハートが突然真っ赤っかになってビックリ．
</p></div>
<hr>
<h2>絵文字を無効にするプラグインの導入</h2>
<div class="myclass">
&#8220;<a href="https://wordpress.org/plugins/disable-emojis/" target="_blank">Disable Emojis</a>&#8221; プラグインを導入して有効化する．</p>
<p><div id="attachment_1950" style="width: 310px" class="wp-caption aligncenter"><a href="https://ba.sozo.ac.jp/myama/home/wp-content/uploads/2015/01/plugin-disable-emojis.png" data-rel="lightbox-image-1" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1950" src="https://ba.sozo.ac.jp/myama/home/wp-content/uploads/2015/01/plugin-disable-emojis-300x226.png" alt="Plugin: Disable Emojis" width="300" height="226" class="size-medium wp-image-1950" srcset="https://ba.sozo.ac.jp/myama/home/wp-content/uploads/2015/01/plugin-disable-emojis-300x226.png 300w, https://ba.sozo.ac.jp/myama/home/wp-content/uploads/2015/01/plugin-disable-emojis.png 566w" sizes="(max-width: 300px) 100vw, 300px" /></a><p id="caption-attachment-1950" class="wp-caption-text">Plugin: Disable Emojis</p></div>
</div>
<hr>
<h2>絵文字無効化後の表示</h2>
<div class="myclass">
<div id="attachment_1949" style="width: 310px" class="wp-caption aligncenter"><a href="https://ba.sozo.ac.jp/myama/home/wp-content/uploads/2015/01/emoji-enabled2.png" data-rel="lightbox-image-2" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1949" src="https://ba.sozo.ac.jp/myama/home/wp-content/uploads/2015/01/emoji-enabled2-300x214.png" alt="絵文字無効" width="300" height="214" class="size-medium wp-image-1949" srcset="https://ba.sozo.ac.jp/myama/home/wp-content/uploads/2015/01/emoji-enabled2-300x214.png 300w, https://ba.sozo.ac.jp/myama/home/wp-content/uploads/2015/01/emoji-enabled2.png 825w" sizes="(max-width: 300px) 100vw, 300px" /></a><p id="caption-attachment-1949" class="wp-caption-text">絵文字無効</p></div>
</div>
<hr>
<h2>結果と感想</h2>
<div class="myclass">
<ul>
<li>すっきり</li>
<li>WordPress本体の設定で選択できるようにしてほしい</li>
</ul>
</div>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>MathJaxを試す</title>
		<link>https://ba.sozo.ac.jp/myama/home/archives/1494</link>
		
		<dc:creator><![CDATA[山口]]></dc:creator>
		<pubDate>Tue, 19 Aug 2014 17:08:04 +0000</pubDate>
				<category><![CDATA[雑記]]></category>
		<category><![CDATA[WordPress]]></category>
		<guid isPermaLink="false">http://ba.sozo.ac.jp/myama/home/?p=1494</guid>

					<description><![CDATA[WebページにLaTeX数式を書けるJavaScriptライブラリ MathJax を試してみる．このサイト（WordPress）で利用できるようにする． MathJaxhttp://www.math&#46;&#46;&#46;]]></description>
										<content:encoded><![CDATA[<p>WebページにLaTeX数式を書けるJavaScriptライブラリ MathJax を試してみる．このサイト（WordPress）で利用できるようにする．</p>
<div class="myclass">
<blockquote><p>MathJax<br /><a href="http://www.mathjax.org/" target="_blank">http://www.mathjax.org/</a><br />
MathJax-LaTeX<br /><a href="http://wordpress.org/plugins/mathjax-latex/" target="_blank">http://wordpress.org/plugins/mathjax-latex/</a>
</p></blockquote>
</div>
<hr>
<h2>動機</h2>
<div class="myclass">
<ul>
<li>たまたま見かけて衝撃を受けたのですぐに試さねばなるまいと</li>
</ul>
</div>
<hr>
<h2>TeXとは</h2>
<div class="myclass">
<ul>
<li>組版処理ソフトウェア．マークアップ言語処理系．</li>
<li>TeX上のマクロパッケージがLaTeX</li>
<li>理・工学系ではお馴染みというか論文執筆に使用必須</li>
<li>文系の人でも数学なんかの教科書でTeXで書かれたものを見てるはず</li>
<li>MathJaxはWeb上でもLaTeX数式をきれいに見せるためのJavaScriptライブラリ</li>
</ul>
</div>
<hr>
<h2>手順（WordPressプラグイン）</h2>
<div class="myclass">
<ul>
<li>プラグイン MathJax-LaTeX を検索してインストールするだけ</li>
<li>通常のサイトに設置する場合は，上記参考サイトの手順を参考に．</li>
</ul>
</div>
<hr>
<h2>使い方</h2>
<div class="myclass">
ShortCodeを使ってLaTeX数式をそのまんま書く．</p>
<p>例としてあのフィルタの伝達関数を書いてみると<br />
[latex]<br />
H(z)=1-z^{-N}<br />
[/latex]</p>
<pre class="lang:default decode:true " >[latex]
H(z)=1-z^{-N}
[/latex]
</pre>
<p>あの変換も書いてみると<br />
[latex]<br />
X(k)=\sum_{n=0}^{N-1}x(n)\exp\left(-j\frac{2\pi}{N}kn\right)<br />
[/latex]</p>
<pre class="lang:default decode:true " >[latex]
X(k)=\sum_{n=0}^{N-1}x(n)\exp\left(-j\frac{2\pi}{N}kn\right)
[/latex]</pre>
<p>ついでに array を試しながらデルタ関数<br />
[latex]<br />
\int_{-\infty}^{\infty}\delta(t)dt = 1 \\<br />
\delta(t)=\left\{<br />
\begin{array}{ll}<br />
\infty, &#038; t=0 \\<br />
0, &#038; t\neq 0<br />
\end{array}<br />
\right.<br />
[/latex]</p>
<pre class="lang:default decode:true " >[latex]
\int_{-\infty}^{\infty}\delta(t)dt = 1 \\
\delta(t)=\left\{
\begin{array}{ll}
\infty, &amp; t=0 \\
0, &amp; t\neq 0
\end{array}
\right.
[/latex]</pre>
</div>
<hr>
<h2>感想</h2>
<div class="myclass">
感激．<br />
プロジェクトは2009年にスタートしているそう．まったく知らず．<br />
数式左寄せはスタイルを修正する必要がありそう．<br />
インラインで挿入する場合はバックスラッシュ＋カッコでくくる．<br />
こんな感じになる．\(\rightarrow x(t)\)</p>
<pre class="lang:default decode:true " >こんな感じになる．\(\rightarrow x(t)\)</pre>
</div>
<hr>
<h2>参考サイト</h2>
<div class="myclass">
<ul>
<li>MathJax<br /><a href="http://www.mathjax.org/" target="_blank">http://www.mathjax.org/</a></li>
<li>MathJax-LaTeX<br /><a href="http://wordpress.org/plugins/mathjax-latex/" target="_blank">http://wordpress.org/plugins/mathjax-latex/</a></li>
</ul>
</div>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>WordPress プラグイン作成を試す</title>
		<link>https://ba.sozo.ac.jp/myama/home/archives/1280</link>
					<comments>https://ba.sozo.ac.jp/myama/home/archives/1280#respond</comments>
		
		<dc:creator><![CDATA[山口]]></dc:creator>
		<pubDate>Mon, 16 Dec 2013 11:40:48 +0000</pubDate>
				<category><![CDATA[開発・サービス]]></category>
		<category><![CDATA[雑記]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[プログラミング]]></category>
		<guid isPermaLink="false">http://ba.sozo.ac.jp/myama/home/?p=1280</guid>

					<description><![CDATA[WordPress のプラグインを作ってみる．参考にした主なサイトは次のとおり． Shortcode API « WordPress Codexhttp://www.communitycom.jp/2&#46;&#46;&#46;]]></description>
										<content:encoded><![CDATA[<p>WordPress のプラグインを作ってみる．参考にした主なサイトは次のとおり．</p>
<div class="myclass">
<blockquote><p>Shortcode API « WordPress Codex<br /><a href="http://codex.wordpress.org/Shortcode_API target="_blank">http://codex.wordpress.org/Shortcode_API</a>
</p></blockquote>
<blockquote><p>WordPressの投稿画面から、PhotoshopやIllustratorのデータ（拡張子がPsdやAiのファイルデータ）をアップロードする方法<br /><a href="http://www.communitycom.jp/2012/10/01/wordpress-psd-ai/ target="_blank">http://www.communitycom.jp/2012/10/01/wordpress-psd-ai/</a>
</p></blockquote>
</div>
<hr>
<h2>動機</h4>
<div class="myclass">
<ul>
<li>以前に Java Applet ベースの ttyplayer を教育用に使っていた<br />⇒ JavaScript ぐらいで誰か作ってないかしら？<br />⇒ 発見。だけどそのままじゃ WordPress で使えない<br />GitHub &#8211; <a href="https://github.com/encryptio/jsttyplay" target="_blank" rel="noopener">https://github.com/encryptio/jsttyplay</a></li>
<li>プラグインにしてしまおう</li>
<li>.tty ファイルのURLを引数とした Shortcode にしてみようかしら</li>
</ul>
</div>
<hr>
<h2>試した環境</h2>
<div class="myclass">
<ul>
<li>WordPress 3.6.1</li>
</ul>
</div>
<hr>
<h2>手順</h2>
<div class="myclass">
<ul>
<li>（書こうと思ったけど省略）参考サイトの情報がとっても有益</li>
<li>下記 92行目～が shortcode 作成の部分</li>
<li>下記 23～81行目が設定ページ（Option、フォントを選択できる）作成の部分</li>
<li>下記 84～88行目が&#8217;upload_mimes&#8217; に拡張子 .tty を追加する部分（メディア追加で .tty ファイルをアップロードできるようにする）</li>
</ul>
</div>
<hr>
<h2>作成後：jsttyplay.php</h2>
<div class="myclass">
&#091;jsttyplay url=&#8221;tty_file_path&#8221;&#093; で動作する。<br />
いろいろ良くないところを残したまま、とりあえず公開してみる。誰かもっと素敵に作ってください。</p>
<pre class="lang:php decode:true " title="jsttyplay.php" data-url="https://ba.sozo.ac.jp/myama/home/wp-content/uploads/2013/12/jsttyplay.php_.txt" ></pre>
</div>
<hr>
<h2>公開場所</h2>
<div class="myclass">
<a href="https://ba.sozo.ac.jp/myama/home/develop/jsttyplay" title="WP Jsttyplay – jsttyplay plugin for WordPress">こちらから</a></div>
<hr>
<h2>参考サイト</h2>
<div class="myclass">
<ul>
<li>Shortcode API « WordPress Codex<br /><a href="http://codex.wordpress.org/Shortcode_API target="_blank">http://codex.wordpress.org/Shortcode_API</a></li>
<li>WordPressの投稿画面から、PhotoshopやIllustratorのデータ（拡張子がPsdやAiのファイルデータ）をアップロードする方法<br /><a href="http://www.communitycom.jp/2012/10/01/wordpress-psd-ai/ target="_blank">http://www.communitycom.jp/2012/10/01/wordpress-psd-ai/</a></li>
</ul>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://ba.sozo.ac.jp/myama/home/archives/1280/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>「OGPの仕様追加：記事にひもづくFBページや個人アカウントとの連携を強める」を試す</title>
		<link>https://ba.sozo.ac.jp/myama/home/archives/1054</link>
					<comments>https://ba.sozo.ac.jp/myama/home/archives/1054#respond</comments>
		
		<dc:creator><![CDATA[山口]]></dc:creator>
		<pubDate>Fri, 26 Jul 2013 17:25:42 +0000</pubDate>
				<category><![CDATA[雑記]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[WordPress]]></category>
		<guid isPermaLink="false">http://ba.sozo.ac.jp/myama/home/?p=1054</guid>

					<description><![CDATA[次の記事にあるとおり、Facebook のニュースフィード上に記事が流れるときに「いいね！」ボタンや「フォローボタン」が表示されるように試してみる。 OGPの仕様追加：記事にひもづくFBページや個人ア&#46;&#46;&#46;]]></description>
										<content:encoded><![CDATA[<p>次の記事にあるとおり、Facebook のニュースフィード上に記事が流れるときに「いいね！」ボタンや「フォローボタン」が表示されるように試してみる。</p>
<div class="myclass">
<blockquote><p>OGPの仕様追加：記事にひもづくFBページや個人アカウントとの連携を強める<br />
<a href="http://facebook-docs.oklahome.net/archives/52099811.html" target="_blank">http://facebook-docs.oklahome.net/archives/52099811.html</a>
</p></blockquote>
</div>
<hr>
<h2>試した環境および前提（Web上に記事はたくさんあるので検索されたし）</h2>
<div class="myclass">
<ul>
<li>WordPress 3.5.2-ja + Facebook プラグイン（公式）バージョン1.4</li>
<li>Facebook Developer 登録・アプリ設定を終えていて、かつ Facebook プラグインの設定も完了し動作していること</li>
</ul>
<p>今回は個人アカウントでなく、Facebook ページにひもづけるようにする。<br />
次のOGPメタデータを埋め込む必要がある。</p>
<p>[crayon]<br />
<meta property="article:publisher" content="https://www.facebook.com/YourFBPage" /><br />
[/crayon]</p>
<p>URL の YourFBPage はひもづけたい Facebook ページを指定する。<br />
しかしながら、現在のところFacebookプラグインが対応していない様子のため、手動で関連ファイルを編集する。
</p></div>
<hr>
<h2>やりたいこと</h2>
<div class="myclass">
<ul>
<li>article:publisher を指定したい（記事を Facebook ページにひもづけ）</li>
<li>article:author をとりあえず消したい（個人とはひもづけない）<br />
（※ プラグインのデフォルト動作では author が出力される）</li>
</ul>
</div>
<hr>
<h2>作業</h2>
<div class="myclass">
テーマ編集から functions.php を選び、次のコードを追記する。</p>
<p>[crayon]<br />
function my_ogp_filter( $meta_tags ) {<br />
  $meta_tags[&#8216;http://ogp.me/ns/article#publisher&#8217;] = &#8216;https://www.facebook.com/YourFBPage&#8217;;</p>
<p>  unset($meta_tags[&#8216;http://ogp.me/ns/article#author&#8217;]);</p>
<p>  return $meta_tags;<br />
}<br />
add_filter( &#8216;fb_meta_tags&#8217;, &#8216;my_ogp_filter&#8217; );<br />
[/crayon]</p>
<p>意味<br />
1行目　フィルタ作成<br />
2行目　article:publisher 追加<br />
4行目　article:author 削除<br />
8行目　フィルタ適用</p>
</div>
<hr>
<h2>結果</h2>
<div class="myclass">
次のとおり。Publisher リンクは表示される様子。ボタンは冒頭の記事のようには出ない？<br />
ということでよくわからずじまい。</p>
<p><a href="https://ba.sozo.ac.jp/myama/home/wp-content/uploads/2013/07/ogpsetting20130727.png" data-rel="lightbox-image-0" data-rl_title="" data-rl_caption=""><img loading="lazy" decoding="async" src="https://ba.sozo.ac.jp/myama/home/wp-content/uploads/2013/07/ogpsetting20130727.png" alt="" title="" width="520" height="212" class="alignnone size-full wp-image-1038" srcset="https://ba.sozo.ac.jp/myama/home/wp-content/uploads/2013/07/ogpsetting20130727.png 520w, https://ba.sozo.ac.jp/myama/home/wp-content/uploads/2013/07/ogpsetting20130727-300x122.png 300w" sizes="(max-width: 520px) 100vw, 520px" /></a>
</div>
<hr>
<h2>参考サイト</h2>
<div class="myclass">
<ul>
<li>OGPの仕様追加：記事にひもづくFBページや個人アカウントとの連携を強める<br />
<a href="http://facebook-docs.oklahome.net/archives/52099811.html" target="_blank">http://facebook-docs.oklahome.net/archives/52099811.html</a></li>
<li>Custom WordPress filters and actions<br />
<a href="https://developers.facebook.com/wordpress/custom-filters-actions/#fb_meta_tags" target="_blank">https://developers.facebook.com/wordpress/custom-filters-actions/#fb_meta_tags</a></li>
<li>Customize Open Graph protocol for your site or network<br />
<a href="http://wordpress.org/support/topic/customize-open-graph-protocol-for-your-site-or-network" target="_blank">http://wordpress.org/support/topic/customize-open-graph-protocol-for-your-site-or-network</a></li>
<li>Facebook Debugger<br />
<a href="https://developers.facebook.com/tools/debug" target="_blank">https://developers.facebook.com/tools/debug</a></li>
</ul>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://ba.sozo.ac.jp/myama/home/archives/1054/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
