<?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>pickup - わぷ道</title>
	<atom:link href="https://wapu-dou.com/post/tag/pickup/feed/" rel="self" type="application/rss+xml" />
	<link>https://wapu-dou.com</link>
	<description>主にWordPressで日々詰まったことなど、解決した際の備忘録として残していきたいと思い、作成しました。 そのほかにも、役立つ情報なんかを書いていければと思います。</description>
	<lastBuildDate>Thu, 09 Feb 2023 08:41:26 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.1</generator>
	<item>
		<title>PCとスマホでJSの処理を変更する方法</title>
		<link>https://wapu-dou.com/post/472/</link>
					<comments>https://wapu-dou.com/post/472/#comments</comments>
		
		<dc:creator><![CDATA[akkunday]]></dc:creator>
		<pubDate>Thu, 08 Dec 2022 02:04:17 +0000</pubDate>
				<category><![CDATA[ウェブ制作]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[pickup]]></category>
		<guid isPermaLink="false">https://wapu-dou.com/?p=472</guid>

					<description><![CDATA[<p>PCとスマホで表示を変える方法 CSSであれば、メディアクエリを使って画面幅に応じたスタイルを当てるようにすると思います。 しかし、出したい要件がPCとスマホで全然違っていたり、どうしても配置を変えたいけどCSSだけじゃ対応しきれない場合な…</p>
<p>The post <a href="https://wapu-dou.com/post/472/">PCとスマホでJSの処理を変更する方法</a> first appeared on <a href="https://wapu-dou.com">わぷ道</a>.</p>]]></description>
										<content:encoded><![CDATA[<h2>PCとスマホで表示を変える方法</h2>
<p>CSSであれば、メディアクエリを使って画面幅に応じたスタイルを当てるようにすると思います。<br>
しかし、出したい要件がPCとスマホで全然違っていたり、どうしても配置を変えたいけどCSSだけじゃ対応しきれない場合など、PC、スマホでソースを書き換える時にJSで表示の条件分岐をする方法を紹介します。
</p>

<h2>どういった方法を使うのか</h2>
<p>JSでPC、スマホで表示を変えようと思った時に使う方法は主に２つあります。<br>
１つは画面幅を取得して、その画面幅を元にPCかスマホかの判定をするパターン<br>
２つ目は、UserAgent(ユーザーエージェント)の値を取得して何のデバイスで見ているかを判定するパターンです。
</p>

<h3>画面幅で判定をする場合</h3>
<p>画面幅で判定をする場合は、下記のような処理を行います。<br>
デバイスではなく画面幅に依存するため、スマホでも縦向きで見る時、横向きで見る時の処理を変えたり柔軟な対応が行えます。
</p>
<pre class="line-numbers"><code class="language-js">var windowWidth = $(window).width();
var windowSm = 640;
if (windowWidth &lt;= windowSm) {
    //横幅640px以下（スマホの場合の処理）
} else {
    //横幅641px以上（PCの場合の処理）
}
</code></pre>

<h3>UserAgent(ユーザーエージェント)で判定をする場合</h3>
<p>UserAgent(ユーザーエージェント)を判定をする場合は下記のような処理を行います。<br>
デバイスや使用ブラウザに応じて処理を変更するため、先ほどのようにスマホの縦向き、横向きで処理を変えると言った事は出来ませんが、細かいデバイスの指定が出来るため、iPhoneの場合、Androidの場合、iPadの場合で処理を変えたり、PCでも、MacBookの場合、Windowsの場合、chromeの場合、safariの場合などの細かい指定が出来ます。<br>
下記の参考ソースでは、PC、スマホで処理を変えるために「iPhone,iPod,Android」の場合と、それ以外の場合で処理を変更しています。</p>
<pre class="line-numbers"><code class="language-js">if (navigator.userAgent.indexOf(&#039;iPhone&#039;) &gt; 0 || navigator.userAgent.indexOf(&#039;iPod&#039;) &gt; 0 || navigator.userAgent.indexOf(&#039;Android&#039;) &gt; 0) {
    // スマホの場合の処理
} else {
    // PCの場合の処理
}
</code></pre>

<h2>まとめ</h2>
<p>用途やサイト全体の作りに応じてどちらを使うか、両方を使うかなど考えながら使ってみてください。<br>
どちらの方法もそれぞれメリット・デメリットがありますが、実際にはもっと細かく指定する事で、タブレットの場合はどうするか、小さなモニターではどうするか等、詳細な設定が行えます。
</p>		<div class="wpulike wpulike-animated-heart " ><div class="wp_ulike_general_class wp_ulike_is_not_liked"><button type="button"
					aria-label="いいねボタン"
					data-ulike-id="472"
					data-ulike-nonce="6624e7ec43"
					data-ulike-type="post"
					data-ulike-template="wpulike-animated-heart"
					data-ulike-display-likers=""
					data-ulike-likers-style="popover"
					data-ulike-append="&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop one&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop two&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop three&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop four&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop five&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop six&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop seven&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop eight&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop nine&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;"
					class="wp_ulike_btn wp_ulike_put_image wp_post_btn_472"><svg class="wpulike-svg-heart wpulike-svg-heart-icon" viewBox="0 -28 512.00002 512" xmlns="http://www.w3.org/2000/svg"><path
						d="m471.382812 44.578125c-26.503906-28.746094-62.871093-44.578125-102.410156-44.578125-29.554687 0-56.621094 9.34375-80.449218 27.769531-12.023438 9.300781-22.917969 20.679688-32.523438 33.960938-9.601562-13.277344-20.5-24.660157-32.527344-33.960938-23.824218-18.425781-50.890625-27.769531-80.445312-27.769531-39.539063 0-75.910156 15.832031-102.414063 44.578125-26.1875 28.410156-40.613281 67.222656-40.613281 109.292969 0 43.300781 16.136719 82.9375 50.78125 124.742187 30.992188 37.394531 75.535156 75.355469 127.117188 119.3125 17.613281 15.011719 37.578124 32.027344 58.308593 50.152344 5.476563 4.796875 12.503907 7.4375 19.792969 7.4375 7.285156 0 14.316406-2.640625 19.785156-7.429687 20.730469-18.128907 40.707032-35.152344 58.328125-50.171876 51.574219-43.949218 96.117188-81.90625 127.109375-119.304687 34.644532-41.800781 50.777344-81.4375 50.777344-124.742187 0-42.066407-14.425781-80.878907-40.617188-109.289063zm0 0" /></svg></button><span class="count-box wp_ulike_counter_up" data-ulike-counter-value=""></span>			</div></div><p>The post <a href="https://wapu-dou.com/post/472/">PCとスマホでJSの処理を変更する方法</a> first appeared on <a href="https://wapu-dou.com">わぷ道</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://wapu-dou.com/post/472/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>数値の四捨五入、切り捨て、切り上げをする方法</title>
		<link>https://wapu-dou.com/post/456/</link>
					<comments>https://wapu-dou.com/post/456/#comments</comments>
		
		<dc:creator><![CDATA[akkunday]]></dc:creator>
		<pubDate>Wed, 23 Nov 2022 09:07:05 +0000</pubDate>
				<category><![CDATA[ウェブ制作]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[pickup]]></category>
		<guid isPermaLink="false">https://wapu-dou.com/?p=456</guid>

					<description><![CDATA[<p>四捨五入をする round関数を用いて「round(値,桁指定)」のように指定します。 桁を指定していない場合は小数点以下の四捨五入となります。 桁指定をした場合 プラスの引数での指定 「1,2,3」等プラスの引数を指定すると小数点第何位ま…</p>
<p>The post <a href="https://wapu-dou.com/post/456/">数値の四捨五入、切り捨て、切り上げをする方法</a> first appeared on <a href="https://wapu-dou.com">わぷ道</a>.</p>]]></description>
										<content:encoded><![CDATA[<h2>四捨五入をする</h2>
<p>round関数を用いて「round(値,桁指定)」のように指定します。<br>
桁を指定していない場合は小数点以下の四捨五入となります。
</p>
<h3>桁指定をした場合</h3>
<h4>プラスの引数での指定</h4>
<p>「1,2,3」等プラスの引数を指定すると小数点第何位までを表示するかの指定が出来ます。<br>
「1」を指定した場合は小数点以下1桁を残す形で、3.1415 が3.1になり<br>
「2」を指定した場合は小数点以下2桁を残す形となり、3.14となります。</p>
<h4>マイナスの引数での指定</h4>
<p>上記と反対に「-1,-2,-3」とマイナスの引数で指定した場合は整数の何桁以上で四捨五入するかの指定となります。<br>
「-1」を指定した場合は1の桁が四捨五入され1555が1560となり<br>
「-2」を指定した場合は10の桁が四捨五入され1555が1600となります。</p>

<h3>実際のコードと出力内容</h3>
<pre class="line-numbers"><code class="language-php">$a = 3.1415;

echo round($a);
// &gt;&gt;&gt; 3
echo round($a , 1);
// &gt;&gt;&gt; 3.1
echo round($a , 2);
// &gt;&gt;&gt; 3.14

$b = 1555;

echo round($b , -1);
// &gt;&gt;&gt; 1560
echo round($b , -2);
// &gt;&gt;&gt; 1600</code></pre>

<h2>切り上げをする</h2>
<p>ceil関数を使う事で小数点以下を切り上げた数値を取得出来ます。<br>
round関数と違い桁を指定する事は出来ないので小数点にのみ有効です。</p>

<h2>切り下げをする</h2>
<p>floor関数を使う事で小数点以下の切り下げた数値を取得出来ます。
ceil関数同様に、桁の指定は出来ません。</p>

<div class="coution_block">
<p class="coution_block_text">整数の切り上げ、切り捨てを行いたい場合は、ceil関数やfloor関数をそのままことが使う事ができないため、一度切り捨て（上げ）したい桁数が小数点以下になるよう調整する必要があります。
</p>
</div>
<pre class="line-numbers"><code class="language-php">$b = 1555;
echo ceil(($b / 100) * 100);
// &gt;&gt;&gt; 1600
echo floor(($b / 100) * 100);
// &gt;&gt;&gt; 1500</code></pre>
		<div class="wpulike wpulike-animated-heart " ><div class="wp_ulike_general_class wp_ulike_is_not_liked"><button type="button"
					aria-label="いいねボタン"
					data-ulike-id="456"
					data-ulike-nonce="4ccebf2616"
					data-ulike-type="post"
					data-ulike-template="wpulike-animated-heart"
					data-ulike-display-likers=""
					data-ulike-likers-style="popover"
					data-ulike-append="&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop one&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop two&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop three&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop four&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop five&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop six&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop seven&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop eight&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop nine&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;"
					class="wp_ulike_btn wp_ulike_put_image wp_post_btn_456"><svg class="wpulike-svg-heart wpulike-svg-heart-icon" viewBox="0 -28 512.00002 512" xmlns="http://www.w3.org/2000/svg"><path
						d="m471.382812 44.578125c-26.503906-28.746094-62.871093-44.578125-102.410156-44.578125-29.554687 0-56.621094 9.34375-80.449218 27.769531-12.023438 9.300781-22.917969 20.679688-32.523438 33.960938-9.601562-13.277344-20.5-24.660157-32.527344-33.960938-23.824218-18.425781-50.890625-27.769531-80.445312-27.769531-39.539063 0-75.910156 15.832031-102.414063 44.578125-26.1875 28.410156-40.613281 67.222656-40.613281 109.292969 0 43.300781 16.136719 82.9375 50.78125 124.742187 30.992188 37.394531 75.535156 75.355469 127.117188 119.3125 17.613281 15.011719 37.578124 32.027344 58.308593 50.152344 5.476563 4.796875 12.503907 7.4375 19.792969 7.4375 7.285156 0 14.316406-2.640625 19.785156-7.429687 20.730469-18.128907 40.707032-35.152344 58.328125-50.171876 51.574219-43.949218 96.117188-81.90625 127.109375-119.304687 34.644532-41.800781 50.777344-81.4375 50.777344-124.742187 0-42.066407-14.425781-80.878907-40.617188-109.289063zm0 0" /></svg></button><span class="count-box wp_ulike_counter_up" data-ulike-counter-value=""></span>			</div></div><p>The post <a href="https://wapu-dou.com/post/456/">数値の四捨五入、切り捨て、切り上げをする方法</a> first appeared on <a href="https://wapu-dou.com">わぷ道</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://wapu-dou.com/post/456/feed/</wfw:commentRss>
			<slash:comments>5780</slash:comments>
		
		
			</item>
		<item>
		<title>WordPressログイン画面 URLの変更方法</title>
		<link>https://wapu-dou.com/post/414/</link>
					<comments>https://wapu-dou.com/post/414/#comments</comments>
		
		<dc:creator><![CDATA[akkunday]]></dc:creator>
		<pubDate>Fri, 28 Oct 2022 07:09:49 +0000</pubDate>
				<category><![CDATA[ウェブ制作]]></category>
		<category><![CDATA[pickup]]></category>
		<category><![CDATA[プラグイン]]></category>
		<guid isPermaLink="false">https://wapu-dou.com/?p=414</guid>

					<description><![CDATA[<p>WordPressではデフォルトの設定のままだと、「https://dummy-url.com/wp-login/」でログイン画面に行ける他、管理画面上のURLを入れる事で意図せずともログイン画面に遷移させてしまったりします。 2段階認証を…</p>
<p>The post <a href="https://wapu-dou.com/post/414/">WordPressログイン画面 URLの変更方法</a> first appeared on <a href="https://wapu-dou.com">わぷ道</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>WordPressではデフォルトの設定のままだと、「https://dummy-url.com/wp-login/」でログイン画面に行ける他、管理画面上のURLを入れる事で意図せずともログイン画面に遷移させてしまったりします。<br>
2段階認証を用意したり、Basic認証をつけたりとログインされないようにセキュリティ対策をするのと同時にログイン画面自体にも行かせない事が理想的だと思います。<br>
今回はプラグインで簡単にログイン画面のURLを固定し、他のURLではログイン画面に遷移させないようにする方法を紹介します。
</p>
<h2>プラグイン「WPS Hide Login」</h2>
<div class="reference_site_block">
<p class="reference_site_title">参考にしたサイト</p>
<a href="https://example.com" target="_blank" rel="noopener">https://ja.wordpress.org/plugins/wps-hide-login/</a>
</div>
<p>このプラグインをインストールし、有効化すると「設定　＞　一般」の中に「WPS Hide Login」の項目が追加されます。</p>
<img fetchpriority="high" decoding="async" src="https://wapu-dou.com/wp-content/uploads/2022/10/Screenshot_18.png" alt="" width="1029" height="336" class="alignnone size-full wp-image-416" srcset="https://wapu-dou.com/wp-content/uploads/2022/10/Screenshot_18.png 1029w, https://wapu-dou.com/wp-content/uploads/2022/10/Screenshot_18-300x98.png 300w, https://wapu-dou.com/wp-content/uploads/2022/10/Screenshot_18-768x251.png 768w" sizes="(max-width: 1029px) 100vw, 1029px" />
<p>入力項目は２つ、「ログインURL」と「リダイレクトURL」があります。<br>
こちらはそれぞれ、ログイン用画面のURLを自動で指定出来る物(デフォルトだと「login」)と間違ったURLを入れた時にリダイレクトされるページ（デフォルトだと「404」)を指定出来ます。
</p>		<div class="wpulike wpulike-animated-heart " ><div class="wp_ulike_general_class wp_ulike_is_not_liked"><button type="button"
					aria-label="いいねボタン"
					data-ulike-id="414"
					data-ulike-nonce="af85cd0ff3"
					data-ulike-type="post"
					data-ulike-template="wpulike-animated-heart"
					data-ulike-display-likers=""
					data-ulike-likers-style="popover"
					data-ulike-append="&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop one&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop two&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop three&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop four&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop five&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop six&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop seven&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop eight&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop nine&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;"
					class="wp_ulike_btn wp_ulike_put_image wp_post_btn_414"><svg class="wpulike-svg-heart wpulike-svg-heart-icon" viewBox="0 -28 512.00002 512" xmlns="http://www.w3.org/2000/svg"><path
						d="m471.382812 44.578125c-26.503906-28.746094-62.871093-44.578125-102.410156-44.578125-29.554687 0-56.621094 9.34375-80.449218 27.769531-12.023438 9.300781-22.917969 20.679688-32.523438 33.960938-9.601562-13.277344-20.5-24.660157-32.527344-33.960938-23.824218-18.425781-50.890625-27.769531-80.445312-27.769531-39.539063 0-75.910156 15.832031-102.414063 44.578125-26.1875 28.410156-40.613281 67.222656-40.613281 109.292969 0 43.300781 16.136719 82.9375 50.78125 124.742187 30.992188 37.394531 75.535156 75.355469 127.117188 119.3125 17.613281 15.011719 37.578124 32.027344 58.308593 50.152344 5.476563 4.796875 12.503907 7.4375 19.792969 7.4375 7.285156 0 14.316406-2.640625 19.785156-7.429687 20.730469-18.128907 40.707032-35.152344 58.328125-50.171876 51.574219-43.949218 96.117188-81.90625 127.109375-119.304687 34.644532-41.800781 50.777344-81.4375 50.777344-124.742187 0-42.066407-14.425781-80.878907-40.617188-109.289063zm0 0" /></svg></button><span class="count-box wp_ulike_counter_up" data-ulike-counter-value=""></span>			</div></div><p>The post <a href="https://wapu-dou.com/post/414/">WordPressログイン画面 URLの変更方法</a> first appeared on <a href="https://wapu-dou.com">わぷ道</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://wapu-dou.com/post/414/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>投稿IDから記事の内容を取得する方法</title>
		<link>https://wapu-dou.com/post/378/</link>
					<comments>https://wapu-dou.com/post/378/#comments</comments>
		
		<dc:creator><![CDATA[akkunday]]></dc:creator>
		<pubDate>Wed, 12 Oct 2022 12:09:03 +0000</pubDate>
				<category><![CDATA[ウェブ制作]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[pickup]]></category>
		<guid isPermaLink="false">https://wapu-dou.com/?p=378</guid>

					<description><![CDATA[<p>投稿のIDから記事の内容を色々取得してみます 固定ページや、別の記事ページに、特定の記事の内容を取得、表示したい時に使ってください。 指定ID記事の投稿タイトルを取得 &#60;?php echo get_post( 1 )-&#62;post…</p>
<p>The post <a href="https://wapu-dou.com/post/378/">投稿IDから記事の内容を取得する方法</a> first appeared on <a href="https://wapu-dou.com">わぷ道</a>.</p>]]></description>
										<content:encoded><![CDATA[<h2>投稿のIDから記事の内容を色々取得してみます</h2>
<p>固定ページや、別の記事ページに、特定の記事の内容を取得、表示したい時に使ってください。</p>

<h3>指定ID記事の投稿タイトルを取得</h3>
<pre class="line-numbers"><code class="language-php">&lt;?php echo get_post( 1 )-&gt;post_title; ?&gt;</code></pre>

<h3>指定ID記事のパーマリンク取得</h3>
<pre class="line-numbers"><code class="language-php">&lt;?php echo get_permalink( 1 ); ?&gt;</code></pre>

<h3>指定ID記事のカスタムフィールド名「test」を取得</h3>
<pre class="line-numbers"><code class="language-php">&lt;?php echo get_post_meta(1,&#039;test&#039;, true); ?&gt;</code></pre>

<h3>指定ID記事の本文を取得</h3>
<pre class="line-numbers"><code class="language-php">&lt;?php echo get_post(1)-&gt;post_content; ?&gt;</code></pre>

<div class="coution_block">
<p class="coution_block_text">get_the_contentはループの中でしか使えず、そのままID指定で取得する事が出来ません。</p>
</div>

<h3>指定ID記事のサムネイルを取得</h3>
<h4>画像パスを取得したい場合</h4>
<pre class="line-numbers"><code class="language-php">&lt;?php echo get_the_post_thumbnail_url( 1, &#039;medium&#039; );?&gt;</code></pre>
<h4>画像を出力したい場合</h4>
<pre class="line-numbers"><code class="language-php">&lt;?php get_the_post_thumbnail( 1, &#039;medium&#039; );?&gt;</code></pre>
<div class="coution_block">
<p class="coution_block_text">サイズはそれぞれ「’thumbnail’, ‘medium’, ‘large’, ‘full’」から選択出来ます。<br>
サイズを省略した場合は「thumbnail」のサイズが取得されます。</p>
</div>

<h3>指定ID記事の投稿者情報を取得</h3>
<p>まずは「$author」の変数に投稿者データをまとめて取得します。</p>
<pre class="line-numbers"><code class="language-php">&lt;?php $author = get_userdata(get_post(1)-&gt;post_author); ?&gt;</code></pre>

<table>
<tr><th>投稿者ID</th><td>$author->ID;</td></tr>
<tr><th>投稿者名</th><td>$author->user_login;</td></tr>
<tr><th>ニックネーム</th><td>$author->user_nicename;</td></tr>
<tr><th>表示名<br>
(ユーザー設定で変更出来る表示する用の名前)
</th><td>$author->display_name;</td></tr>
<tr><th>メールアドレス</th><td>$author->user_email</td></tr>
<tr><th>ユーザーのウェブサイトURL</th><td>$author->user_url</td></tr>

</table>		<div class="wpulike wpulike-animated-heart " ><div class="wp_ulike_general_class wp_ulike_is_not_liked"><button type="button"
					aria-label="いいねボタン"
					data-ulike-id="378"
					data-ulike-nonce="a9ff2134ae"
					data-ulike-type="post"
					data-ulike-template="wpulike-animated-heart"
					data-ulike-display-likers=""
					data-ulike-likers-style="popover"
					data-ulike-append="&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop one&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop two&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop three&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop four&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop five&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop six&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop seven&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop eight&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop nine&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;"
					class="wp_ulike_btn wp_ulike_put_image wp_post_btn_378"><svg class="wpulike-svg-heart wpulike-svg-heart-icon" viewBox="0 -28 512.00002 512" xmlns="http://www.w3.org/2000/svg"><path
						d="m471.382812 44.578125c-26.503906-28.746094-62.871093-44.578125-102.410156-44.578125-29.554687 0-56.621094 9.34375-80.449218 27.769531-12.023438 9.300781-22.917969 20.679688-32.523438 33.960938-9.601562-13.277344-20.5-24.660157-32.527344-33.960938-23.824218-18.425781-50.890625-27.769531-80.445312-27.769531-39.539063 0-75.910156 15.832031-102.414063 44.578125-26.1875 28.410156-40.613281 67.222656-40.613281 109.292969 0 43.300781 16.136719 82.9375 50.78125 124.742187 30.992188 37.394531 75.535156 75.355469 127.117188 119.3125 17.613281 15.011719 37.578124 32.027344 58.308593 50.152344 5.476563 4.796875 12.503907 7.4375 19.792969 7.4375 7.285156 0 14.316406-2.640625 19.785156-7.429687 20.730469-18.128907 40.707032-35.152344 58.328125-50.171876 51.574219-43.949218 96.117188-81.90625 127.109375-119.304687 34.644532-41.800781 50.777344-81.4375 50.777344-124.742187 0-42.066407-14.425781-80.878907-40.617188-109.289063zm0 0" /></svg></button><span class="count-box wp_ulike_counter_up" data-ulike-counter-value="+1"></span>			</div></div><p>The post <a href="https://wapu-dou.com/post/378/">投稿IDから記事の内容を取得する方法</a> first appeared on <a href="https://wapu-dou.com">わぷ道</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://wapu-dou.com/post/378/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>WordPressサイトのURLから｢/wp/｣､｢/wordpress/｣などのスラッグを削除する方法</title>
		<link>https://wapu-dou.com/post/248/</link>
					<comments>https://wapu-dou.com/post/248/#comments</comments>
		
		<dc:creator><![CDATA[akkunday]]></dc:creator>
		<pubDate>Wed, 07 Sep 2022 07:46:37 +0000</pubDate>
				<category><![CDATA[ウェブ制作]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[pickup]]></category>
		<guid isPermaLink="false">https://wapu-dou.com/?p=248</guid>

					<description><![CDATA[<p>WordPressサイトの初期設定のURLがおかしい 使っているサーバーなどによって、WordPressをインストールした際に強制的にURLの中に｢/wp/｣や｢/wordpress/｣(以下「/wp/」で統一します)といったスラッグが入る…</p>
<p>The post <a href="https://wapu-dou.com/post/248/">WordPressサイトのURLから｢/wp/｣､｢/wordpress/｣などのスラッグを削除する方法</a> first appeared on <a href="https://wapu-dou.com">わぷ道</a>.</p>]]></description>
										<content:encoded><![CDATA[<h2>WordPressサイトの初期設定のURLがおかしい</h2>
<p>使っているサーバーなどによって、WordPressをインストールした際に強制的にURLの中に｢/wp/｣や｢/wordpress/｣(以下「/wp/」で統一します)といったスラッグが入る事があります。<br>
WordPressで作ったサイトである事は間違いないし、見ればわかる人にはわかるけど、わざわざURL上に出したくはないですよね。<br>
今回はそんなURLの修正方法を紹介していきます。
</p>

<h3>WordPress管理画面からサイトアドレス(URL)の変更</h3>
<p>「設定」→「一般」の中に移動して、サイトアドレスの欄がありますので、そこを下記のように書き換えます</p>
<img decoding="async" src="https://wapu-dou.com/wp-content/uploads/2022/09/ss_248_1.png" alt="" width="800" height="650" class="alignnone size-full wp-image-254" srcset="https://wapu-dou.com/wp-content/uploads/2022/09/ss_248_1.png 800w, https://wapu-dou.com/wp-content/uploads/2022/09/ss_248_1-300x244.png 300w, https://wapu-dou.com/wp-content/uploads/2022/09/ss_248_1-775x630.png 775w, https://wapu-dou.com/wp-content/uploads/2022/09/ss_248_1-768x624.png 768w" sizes="(max-width: 800px) 100vw, 800px" />
<div class="coution_block">
<p class="coution_block_text">この際、一時的にサイトが表示されない状態になりますが、正常な動きなのでそのまま進めてしまって大丈夫です。</p>
</div>

<h3>FTPを使ってファイルをローカルにコピー</h3>
<p>FTP等を使って実際のサイト内のファイル「.htaccess」と「index.php」をローカルに保存します。</p>
<img decoding="async" src="https://wapu-dou.com/wp-content/uploads/2022/09/ss_248_2.png" alt="" width="800" height="580" class="alignnone size-full wp-image-250" srcset="https://wapu-dou.com/wp-content/uploads/2022/09/ss_248_2.png 800w, https://wapu-dou.com/wp-content/uploads/2022/09/ss_248_2-300x218.png 300w, https://wapu-dou.com/wp-content/uploads/2022/09/ss_248_2-768x557.png 768w" sizes="(max-width: 800px) 100vw, 800px" />
<div class="coution_block">
<p class="coution_block_text">「.htaccess」はFTPの設定や、PCの設定によって、FTP上、ローカルフォルダ上で表示されない事があります。<br>
「隠しファイル　表示」などで検索すると表示するための設定方法が出てくると思うので試してみてください。
</p>
</div>

<h3>index.phpの書き換え</h3>
<p>ローカル上にコピーした「index.php」を下記画像のように書き換えます。</p>
<img decoding="async" src="https://wapu-dou.com/wp-content/uploads/2022/09/ss_248_3.png" alt="" width="800" height="700" class="alignnone size-full wp-image-251" srcset="https://wapu-dou.com/wp-content/uploads/2022/09/ss_248_3.png 800w, https://wapu-dou.com/wp-content/uploads/2022/09/ss_248_3-300x263.png 300w, https://wapu-dou.com/wp-content/uploads/2022/09/ss_248_3-720x630.png 720w, https://wapu-dou.com/wp-content/uploads/2022/09/ss_248_3-768x672.png 768w" sizes="(max-width: 800px) 100vw, 800px" />

<h3>コピー、変更したファイルのアップロード</h3>
<p>コピーした「.htaccess」と前項の書き換えが完了した「index.php」ファイルを「/wp/」と同じ階層（最初に入っていたところから1個上の階層）にアップロードします。</p>
<img decoding="async" src="https://wapu-dou.com/wp-content/uploads/2022/09/ss_248_4.png" alt="" width="800" height="250" class="alignnone size-full wp-image-252" srcset="https://wapu-dou.com/wp-content/uploads/2022/09/ss_248_4.png 800w, https://wapu-dou.com/wp-content/uploads/2022/09/ss_248_4-300x94.png 300w, https://wapu-dou.com/wp-content/uploads/2022/09/ss_248_4-768x240.png 768w" sizes="(max-width: 800px) 100vw, 800px" />

<h3>パーマリンク設定の更新</h3>
<p>URL構造を変更したことによって、パーマリンクの設定が初期化されます。<br>
WordPress側の設定画面に戻り、「設定」→「パーマリンク設定」に移動し、パーマリンクを変更しない場合はそのまま更新ボタンを押す事でパーマリンクが再設定されます。
</p>
<img decoding="async" src="https://wapu-dou.com/wp-content/uploads/2022/09/ss_248_5.png" alt="" width="800" height="500" class="alignnone size-full wp-image-253" srcset="https://wapu-dou.com/wp-content/uploads/2022/09/ss_248_5.png 800w, https://wapu-dou.com/wp-content/uploads/2022/09/ss_248_5-300x188.png 300w, https://wapu-dou.com/wp-content/uploads/2022/09/ss_248_5-768x480.png 768w" sizes="(max-width: 800px) 100vw, 800px" />

<p>以上ですべての設定が完了です。<br>
サイト側の表示を確認して問題がある場合はどこかの設定が間違っている可能性があるので再度確認して対応してください。<br>
リンク先などを絶対パスで記載していたりなど、古いURLを指定している箇所がある場合はその辺りも注意して確認する事をおすすめします。
</p>		<div class="wpulike wpulike-animated-heart " ><div class="wp_ulike_general_class wp_ulike_is_not_liked"><button type="button"
					aria-label="いいねボタン"
					data-ulike-id="248"
					data-ulike-nonce="290e5cf982"
					data-ulike-type="post"
					data-ulike-template="wpulike-animated-heart"
					data-ulike-display-likers=""
					data-ulike-likers-style="popover"
					data-ulike-append="&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop one&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop two&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop three&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop four&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop five&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop six&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop seven&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop eight&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop nine&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;"
					class="wp_ulike_btn wp_ulike_put_image wp_post_btn_248"><svg class="wpulike-svg-heart wpulike-svg-heart-icon" viewBox="0 -28 512.00002 512" xmlns="http://www.w3.org/2000/svg"><path
						d="m471.382812 44.578125c-26.503906-28.746094-62.871093-44.578125-102.410156-44.578125-29.554687 0-56.621094 9.34375-80.449218 27.769531-12.023438 9.300781-22.917969 20.679688-32.523438 33.960938-9.601562-13.277344-20.5-24.660157-32.527344-33.960938-23.824218-18.425781-50.890625-27.769531-80.445312-27.769531-39.539063 0-75.910156 15.832031-102.414063 44.578125-26.1875 28.410156-40.613281 67.222656-40.613281 109.292969 0 43.300781 16.136719 82.9375 50.78125 124.742187 30.992188 37.394531 75.535156 75.355469 127.117188 119.3125 17.613281 15.011719 37.578124 32.027344 58.308593 50.152344 5.476563 4.796875 12.503907 7.4375 19.792969 7.4375 7.285156 0 14.316406-2.640625 19.785156-7.429687 20.730469-18.128907 40.707032-35.152344 58.328125-50.171876 51.574219-43.949218 96.117188-81.90625 127.109375-119.304687 34.644532-41.800781 50.777344-81.4375 50.777344-124.742187 0-42.066407-14.425781-80.878907-40.617188-109.289063zm0 0" /></svg></button><span class="count-box wp_ulike_counter_up" data-ulike-counter-value=""></span>			</div></div><p>The post <a href="https://wapu-dou.com/post/248/">WordPressサイトのURLから｢/wp/｣､｢/wordpress/｣などのスラッグを削除する方法</a> first appeared on <a href="https://wapu-dou.com">わぷ道</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://wapu-dou.com/post/248/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>投稿画面から「タイトル」、「本文」等の入力欄を消す方法</title>
		<link>https://wapu-dou.com/post/242/</link>
					<comments>https://wapu-dou.com/post/242/#comments</comments>
		
		<dc:creator><![CDATA[akkunday]]></dc:creator>
		<pubDate>Mon, 05 Sep 2022 00:03:43 +0000</pubDate>
				<category><![CDATA[ウェブ制作]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[pickup]]></category>
		<guid isPermaLink="false">https://wapu-dou.com/?p=242</guid>

					<description><![CDATA[<p>なぜ入力欄を消したか 以前に完全にカスタムフィールドのみで情報をまとめてテンプレート表示させるサイトを作成した際に「運用者側で余計なミスをしないように使わない入力欄は非表示にしてほしい」という要望がありました。 こちらはその時に行った対応の…</p>
<p>The post <a href="https://wapu-dou.com/post/242/">投稿画面から「タイトル」、「本文」等の入力欄を消す方法</a> first appeared on <a href="https://wapu-dou.com">わぷ道</a>.</p>]]></description>
										<content:encoded><![CDATA[<h2>なぜ入力欄を消したか</h2>
<p>以前に完全にカスタムフィールドのみで情報をまとめてテンプレート表示させるサイトを作成した際に「運用者側で余計なミスをしないように使わない入力欄は非表示にしてほしい」という要望がありました。
<br>こちらはその時に行った対応の一部です。</p>

<h2>使い方</h2>
<p>functions.phpに下記のように記載します。<br>
今回は実際に行った「タイトル」、「本文」、「サムネイル」の入力欄を消すように指定しています。
</p>

<pre class="line-numbers"><code class="language-php">function remove_post_editor() {
     remove_post_type_support('post','title'); //タイトル
     remove_post_type_support('post','editor'); //本文
     remove_post_type_support(‘post’,'thumbnail'); //サムネイル
}
add_action( 'init' , 'remove_post_editor' );
</code></pre>
<div class="voice clearfix left n_bottom"><div class="icon"><img decoding="async" src="https://wapu-dou.com/wp-content/uploads/2022/08/comment_icon1.png"><div class="name">わぷまる</div></div><div class="text sc_balloon left white" >「'post'」の部分は投稿タイプの指定なので、固定ページだったりカスタム投稿ページで利用する場合はここを書き換えると対応できます。</div></div>

<h3>他にはこんな指定も</h3>
<p>今回、非表示にしなかったパーツでも下記のように色々なパーツが同じように指定できます。</p>

<blockquote>'title' （タイトル）<br>'editor' （内容の編集）<br>'author' （作成者）<br>'thumbnail' （アイキャッチ画像）（現在のテーマが 投稿サムネイル をサポートしていること）<br>'excerpt' （抜粋）<br>'trackbacks' （トラックバック送信）<br>'custom-fields' （カスタムフィールド）<br>'comments' （コメントの他、編集画面にコメント数のバルーンを表示する）<br>'revisions' （リビジョンを保存する）<br>'page-attributes' （メニューの順序）（投稿タイプの hierarchical が true であること）<br>'post-formats' （投稿のフォーマットを削除。投稿フォーマットを参照）<div class="blockquote_ref"><div><a href="https://wpdocs.osdn.jp/%E9%96%A2%E6%95%B0%E3%83%AA%E3%83%95%E3%82%A1%E3%83%AC%E3%83%B3%E3%82%B9/remove_post_type_support" target="_blank" rel="noopener">関数リファレンス/remove post type support</a></div></div></blockquote>

<div class="coution_block">
<p class="coution_block_text">タイトルや本文、サムネイル等を非表示にすると、表面上の表示だけでなく、metaデータ等にも入らなくなってしまいます。<br>
こちらの対応を行う場合は、それぞれ必要なデータをmetaに追記出来るようあわせて改修する事をお勧めします。(テーマや利用しているプラグインによって構造が異なります)
</p>
</div>
		<div class="wpulike wpulike-animated-heart " ><div class="wp_ulike_general_class wp_ulike_is_not_liked"><button type="button"
					aria-label="いいねボタン"
					data-ulike-id="242"
					data-ulike-nonce="5432666877"
					data-ulike-type="post"
					data-ulike-template="wpulike-animated-heart"
					data-ulike-display-likers=""
					data-ulike-likers-style="popover"
					data-ulike-append="&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop one&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop two&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop three&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop four&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop five&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop six&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop seven&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop eight&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop nine&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;"
					class="wp_ulike_btn wp_ulike_put_image wp_post_btn_242"><svg class="wpulike-svg-heart wpulike-svg-heart-icon" viewBox="0 -28 512.00002 512" xmlns="http://www.w3.org/2000/svg"><path
						d="m471.382812 44.578125c-26.503906-28.746094-62.871093-44.578125-102.410156-44.578125-29.554687 0-56.621094 9.34375-80.449218 27.769531-12.023438 9.300781-22.917969 20.679688-32.523438 33.960938-9.601562-13.277344-20.5-24.660157-32.527344-33.960938-23.824218-18.425781-50.890625-27.769531-80.445312-27.769531-39.539063 0-75.910156 15.832031-102.414063 44.578125-26.1875 28.410156-40.613281 67.222656-40.613281 109.292969 0 43.300781 16.136719 82.9375 50.78125 124.742187 30.992188 37.394531 75.535156 75.355469 127.117188 119.3125 17.613281 15.011719 37.578124 32.027344 58.308593 50.152344 5.476563 4.796875 12.503907 7.4375 19.792969 7.4375 7.285156 0 14.316406-2.640625 19.785156-7.429687 20.730469-18.128907 40.707032-35.152344 58.328125-50.171876 51.574219-43.949218 96.117188-81.90625 127.109375-119.304687 34.644532-41.800781 50.777344-81.4375 50.777344-124.742187 0-42.066407-14.425781-80.878907-40.617188-109.289063zm0 0" /></svg></button><span class="count-box wp_ulike_counter_up" data-ulike-counter-value=""></span>			</div></div><p>The post <a href="https://wapu-dou.com/post/242/">投稿画面から「タイトル」、「本文」等の入力欄を消す方法</a> first appeared on <a href="https://wapu-dou.com">わぷ道</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://wapu-dou.com/post/242/feed/</wfw:commentRss>
			<slash:comments>19</slash:comments>
		
		
			</item>
		<item>
		<title>【いいねボタン】プラグインで簡単！いいねボタンを設置する方法</title>
		<link>https://wapu-dou.com/post/229/</link>
					<comments>https://wapu-dou.com/post/229/#respond</comments>
		
		<dc:creator><![CDATA[akkunday]]></dc:creator>
		<pubDate>Fri, 26 Aug 2022 23:43:47 +0000</pubDate>
				<category><![CDATA[ウェブ制作]]></category>
		<category><![CDATA[pickup]]></category>
		<category><![CDATA[プラグイン]]></category>
		<guid isPermaLink="false">https://wapu-dou.com/?p=229</guid>

					<description><![CDATA[<p>「WP ULike」でいいねボタンを実装 今回は「WP ULike」というプラグインでブログに「いいね」機能を追加する方法を紹介します。 このプラグインを使うと、SNS等の「いいねボタン」とは別にWordPressに独自の「いいね」機能が追…</p>
<p>The post <a href="https://wapu-dou.com/post/229/">【いいねボタン】プラグインで簡単！いいねボタンを設置する方法</a> first appeared on <a href="https://wapu-dou.com">わぷ道</a>.</p>]]></description>
										<content:encoded><![CDATA[<h2>「WP ULike」でいいねボタンを実装</h2>
<p>今回は「WP ULike」というプラグインでブログに「いいね」機能を追加する方法を紹介します。<br>
このプラグインを使うと、SNS等の「いいねボタン」とは別にWordPressに独自の「いいね」機能が追加できます。
</p>
<h2>基本設定</h2>
<p>細かい設定もたくさんありますが、今回はよく使う設定をピックアップして説明します。</p>

<h3>デザインの指定</h3>
<p>設定画面のcontent typesでボタンのデザインを４パターンから選択出来ます。</p>
<img decoding="async" src="https://wapu-dou.com/wp-content/uploads/2022/08/ss_229_1-300x42.png" alt="" width="300" height="42" class="alignnone size-medium wp-image-234" srcset="https://wapu-dou.com/wp-content/uploads/2022/08/ss_229_1-300x42.png 300w, https://wapu-dou.com/wp-content/uploads/2022/08/ss_229_1-768x107.png 768w, https://wapu-dou.com/wp-content/uploads/2022/08/ss_229_1.png 810w" sizes="(max-width: 300px) 100vw, 300px" />

<p>自動表示の指定と、自動表示をした場合に、どこに表示させるかの設定があります。<br>
ボタンの表示位置、ボタンを出すページ出さないページの指定などが出来ます。
</p>
<img decoding="async" src="https://wapu-dou.com/wp-content/uploads/2022/08/ss_229_2-300x142.png" alt="" width="300" height="142" class="alignnone size-medium wp-image-237" srcset="https://wapu-dou.com/wp-content/uploads/2022/08/ss_229_2-300x142.png 300w, https://wapu-dou.com/wp-content/uploads/2022/08/ss_229_2.png 706w" sizes="(max-width: 300px) 100vw, 300px" />

<div class="voice clearfix left n_bottom"><div class="icon"><img decoding="async" src="https://wapu-dou.com/wp-content/uploads/2022/08/comment_icon1.png"><div class="name">わぷまる</div></div><div class="text sc_balloon left white" >自動表示をしない場合も&#091;wp_ulike&#093;のショートコードを使うと「いいねボタン」を表示出来るので、好きな場所に出したり、テンプレートのテーマ内に埋め込んで調整する事も出来ます。</div></div>

<h3>いいねされた数の表示</h3>
<p>左から、表示する、非表示にする、ログインしているユーザーだけに表示する設定です。</p>
<img decoding="async" src="https://wapu-dou.com/wp-content/uploads/2022/08/ss_229_3-300x35.png" alt="" width="300" height="35" class="alignnone size-medium wp-image-235" srcset="https://wapu-dou.com/wp-content/uploads/2022/08/ss_229_3-300x35.png 300w, https://wapu-dou.com/wp-content/uploads/2022/08/ss_229_3.png 560w" sizes="(max-width: 300px) 100vw, 300px" />

<p>いいねが０回の場合にカウンターを表示するかどうかの設定です。</p>
<img decoding="async" src="https://wapu-dou.com/wp-content/uploads/2022/08/ss_229_4-300x49.png" alt="" width="300" height="49" class="alignnone size-medium wp-image-236" srcset="https://wapu-dou.com/wp-content/uploads/2022/08/ss_229_4-300x49.png 300w, https://wapu-dou.com/wp-content/uploads/2022/08/ss_229_4.png 333w" sizes="(max-width: 300px) 100vw, 300px" />

<div class="together_post_block"><p class="together_post_block_title">あわせて読みたい</p><div class="together_post_flex_inner"><div class="together_post_img"><a href="https://wapu-dou.com/post/224/"><img decoding="async" src="https://wapu-dou.com/wp-content/uploads/2022/08/thumbnail_224.png"></a></div><div class="together_post_flex_text_inner"><p class="together_post_title"><a href="https://wapu-dou.com/post/224/">【いいねボタン】WP Ulikeでいいねされた数を一覧に表示する方法</a></p><time class="together_post_date" datatime="2022-08-25">2022年8月25日</time><a href="https://wapu-dou.com/post/tag/php/" class="together_tag">php</a><a href="https://wapu-dou.com/post/tag/plugin/" class="together_tag">プラグイン</a></div></div></div>		<div class="wpulike wpulike-animated-heart " ><div class="wp_ulike_general_class wp_ulike_is_not_liked"><button type="button"
					aria-label="いいねボタン"
					data-ulike-id="229"
					data-ulike-nonce="987d53fbde"
					data-ulike-type="post"
					data-ulike-template="wpulike-animated-heart"
					data-ulike-display-likers=""
					data-ulike-likers-style="popover"
					data-ulike-append="&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop one&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop two&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop three&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop four&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop five&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop six&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop seven&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop eight&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop nine&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;"
					class="wp_ulike_btn wp_ulike_put_image wp_post_btn_229"><svg class="wpulike-svg-heart wpulike-svg-heart-icon" viewBox="0 -28 512.00002 512" xmlns="http://www.w3.org/2000/svg"><path
						d="m471.382812 44.578125c-26.503906-28.746094-62.871093-44.578125-102.410156-44.578125-29.554687 0-56.621094 9.34375-80.449218 27.769531-12.023438 9.300781-22.917969 20.679688-32.523438 33.960938-9.601562-13.277344-20.5-24.660157-32.527344-33.960938-23.824218-18.425781-50.890625-27.769531-80.445312-27.769531-39.539063 0-75.910156 15.832031-102.414063 44.578125-26.1875 28.410156-40.613281 67.222656-40.613281 109.292969 0 43.300781 16.136719 82.9375 50.78125 124.742187 30.992188 37.394531 75.535156 75.355469 127.117188 119.3125 17.613281 15.011719 37.578124 32.027344 58.308593 50.152344 5.476563 4.796875 12.503907 7.4375 19.792969 7.4375 7.285156 0 14.316406-2.640625 19.785156-7.429687 20.730469-18.128907 40.707032-35.152344 58.328125-50.171876 51.574219-43.949218 96.117188-81.90625 127.109375-119.304687 34.644532-41.800781 50.777344-81.4375 50.777344-124.742187 0-42.066407-14.425781-80.878907-40.617188-109.289063zm0 0" /></svg></button><span class="count-box wp_ulike_counter_up" data-ulike-counter-value="+5"></span>			</div></div><p>The post <a href="https://wapu-dou.com/post/229/">【いいねボタン】プラグインで簡単！いいねボタンを設置する方法</a> first appeared on <a href="https://wapu-dou.com">わぷ道</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://wapu-dou.com/post/229/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>指定したyoutubeチャンネルの新着動画を表示させる方法</title>
		<link>https://wapu-dou.com/post/203/</link>
					<comments>https://wapu-dou.com/post/203/#respond</comments>
		
		<dc:creator><![CDATA[akkunday]]></dc:creator>
		<pubDate>Fri, 19 Aug 2022 13:09:04 +0000</pubDate>
				<category><![CDATA[ウェブ制作]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[pickup]]></category>
		<guid isPermaLink="false">https://wapu-dou.com/?p=203</guid>

					<description><![CDATA[<p>記事の中で紹介したチャンネルの動画や、自分の動画なんかをiframeで埋め込む際に、簡単に行える方法を考えてみました。 この方法では、チャンネルのIDと、取得する動画本数だけをショートコード内に入力して、フィードから動画を取得、表示させてい…</p>
<p>The post <a href="https://wapu-dou.com/post/203/">指定したyoutubeチャンネルの新着動画を表示させる方法</a> first appeared on <a href="https://wapu-dou.com">わぷ道</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>記事の中で紹介したチャンネルの動画や、自分の動画なんかをiframeで埋め込む際に、簡単に行える方法を考えてみました。
この方法では、チャンネルのIDと、取得する動画本数だけをショートコード内に入力して、フィードから動画を取得、表示させています。
</p>
<h2>やろうとした事</h2>
<p>プラグインを使えば簡単に出来る事ですが、APIのキーを取得したりと少し面倒に思ったので、youtubeのfeedを利用する事で簡単に指定したチャンネルの新着動画を取得、表示しようと思ったことから作成しました。</p>
<h2>実際のコード</h2>
<h3>PHP</h3>
<pre class="line-numbers"><code class="language-php">function youtubeList($atts){
  extract(
    shortcode_atts(
      array(
        &#039;channel&#039; =&gt; &#039;&#039;,
        &#039;limit&#039; =&gt; &#039;3&#039;
      )
      , $atts
      )
  );
  $feed=&#039;https://www.youtube.com/feeds/videos.xml?channel_id=&#039;.$channel;
  $xml = simplexml_load_file($feed);
  $obj = get_object_vars($xml);
  $obj_entry = $obj[&quot;entry&quot;];
  if($obj_entry != null){
    $total = count($obj_entry);
    if( $total != 0 ){
      $contents .= &#039;&lt;ul class=&quot;movie_list_wrap&quot;&gt;&#039;;
      for ($i=0; $i &lt; $limit; $i++) {
        foreach ($obj_entry[$i] as $key =&gt; $value) {
          if( in_array($key, array(&#039;id&#039;,&#039;title&#039;,&#039;updated&#039;)) ){
            if( $key==&#039;id&#039;){
                $video_id = str_replace(&#039;yt:video:&#039;, &#039;&#039;, $value[0]);
              };
            if( $key==&#039;title&#039; ){
              $video_title = $value[0];
            };
            if( $key==&#039;updated&#039; ){
              $video_date = date(&#039;Y.m.d&#039;,strtotime($value[0]));
            }
          }else{
            continue;
          }
        }
      $contents .= &#039;&lt;li class=&quot;movie_list&quot;&gt;&lt;div class=&quot;youtube&quot;&gt;&lt;div class=&quot;youtube-container&quot;&gt;&#039;;
      $contents .= &#039;&lt;iframe src=&quot;https://www.youtube.com/embed/&#039;. htmlspecialchars($video_id, ENT_QUOTES, &#039;UTF-8&#039;).&#039;&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;&#039;;
      $contents .= &#039;&lt;/div&gt;&lt;/div&gt;&lt;/li&gt;&#039;;
      }
    $contents .= &#039;&lt;/ul&gt;&#039;;
    }
  }
  $html = $contents;
  return $html;
}
add_shortcode(&#039;youtube_list&#039;,&#039;youtubeList&#039;);</code></pre>
<h3>CSS</h3>
<pre class="line-numbers"><code class="language-css">.movie_list_wrap{
  display:flex;
  gap:10px;
  padding:0;
}
.movie_list_wrap li{
  list-style:none;
}</code></pre>
<p>CSSは最低限の記載なので、それぞれ調整してご利用ください。</p>

<h2>ショートコードの使い方</h2>
<p>記事の中で下記のようにショートコードを挿入する事でそこにyoutubeのiframe動画が表示されます。<br>
</p>
&#091;youtube_list limit=&quot;3&quot; channel=&quot;dummy&quot;&#093;
<p>表示件数は「limit」で指定していてチャンネルIDは「channel」に指定します。<br>
実際の表示がこちらです。
</p>
<ul class="movie_list_wrap"><li class="movie_list"><div class="youtube"><div class="youtube-container"><iframe src="https://www.youtube.com/embed/dTtpj-krnxw" frameborder="0" allowfullscreen></iframe></div></div></li><li class="movie_list"><div class="youtube"><div class="youtube-container"><iframe src="https://www.youtube.com/embed/f0Gp5r10gIM" frameborder="0" allowfullscreen></iframe></div></div></li><li class="movie_list"><div class="youtube"><div class="youtube-container"><iframe src="https://www.youtube.com/embed/lDSVZSnauQU" frameborder="0" allowfullscreen></iframe></div></div></li></ul>
<p class="annotation">※サンプルで使用させていただいた動画は個人的に応援しているチャンネルであり、当方とは一切関係ありません。</p>
		<div class="wpulike wpulike-animated-heart " ><div class="wp_ulike_general_class wp_ulike_is_not_liked"><button type="button"
					aria-label="いいねボタン"
					data-ulike-id="203"
					data-ulike-nonce="7c25a14f7f"
					data-ulike-type="post"
					data-ulike-template="wpulike-animated-heart"
					data-ulike-display-likers=""
					data-ulike-likers-style="popover"
					data-ulike-append="&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop one&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop two&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop three&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop four&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop five&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop six&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop seven&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop eight&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop nine&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;"
					class="wp_ulike_btn wp_ulike_put_image wp_post_btn_203"><svg class="wpulike-svg-heart wpulike-svg-heart-icon" viewBox="0 -28 512.00002 512" xmlns="http://www.w3.org/2000/svg"><path
						d="m471.382812 44.578125c-26.503906-28.746094-62.871093-44.578125-102.410156-44.578125-29.554687 0-56.621094 9.34375-80.449218 27.769531-12.023438 9.300781-22.917969 20.679688-32.523438 33.960938-9.601562-13.277344-20.5-24.660157-32.527344-33.960938-23.824218-18.425781-50.890625-27.769531-80.445312-27.769531-39.539063 0-75.910156 15.832031-102.414063 44.578125-26.1875 28.410156-40.613281 67.222656-40.613281 109.292969 0 43.300781 16.136719 82.9375 50.78125 124.742187 30.992188 37.394531 75.535156 75.355469 127.117188 119.3125 17.613281 15.011719 37.578124 32.027344 58.308593 50.152344 5.476563 4.796875 12.503907 7.4375 19.792969 7.4375 7.285156 0 14.316406-2.640625 19.785156-7.429687 20.730469-18.128907 40.707032-35.152344 58.328125-50.171876 51.574219-43.949218 96.117188-81.90625 127.109375-119.304687 34.644532-41.800781 50.777344-81.4375 50.777344-124.742187 0-42.066407-14.425781-80.878907-40.617188-109.289063zm0 0" /></svg></button><span class="count-box wp_ulike_counter_up" data-ulike-counter-value=""></span>			</div></div><p>The post <a href="https://wapu-dou.com/post/203/">指定したyoutubeチャンネルの新着動画を表示させる方法</a> first appeared on <a href="https://wapu-dou.com">わぷ道</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://wapu-dou.com/post/203/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>ウィジェット活用プラグイン4選</title>
		<link>https://wapu-dou.com/post/183/</link>
					<comments>https://wapu-dou.com/post/183/#respond</comments>
		
		<dc:creator><![CDATA[akkunday]]></dc:creator>
		<pubDate>Wed, 17 Aug 2022 14:02:11 +0000</pubDate>
				<category><![CDATA[ウェブ制作]]></category>
		<category><![CDATA[pickup]]></category>
		<category><![CDATA[プラグイン]]></category>
		<guid isPermaLink="false">https://wapu-dou.com/?p=183</guid>

					<description><![CDATA[<p>ウィジェットとは ウィジェットとは、WordPressのテーマごとに用意されたサイト内のブロックを簡単に表示、非表示、並び替えたり出来る仕組みです。 基本的なWordPressサイトのレイアウトは「ヘッダー」、「ボディ」、「サイドバー」、「…</p>
<p>The post <a href="https://wapu-dou.com/post/183/">ウィジェット活用プラグイン4選</a> first appeared on <a href="https://wapu-dou.com">わぷ道</a>.</p>]]></description>
										<content:encoded><![CDATA[<h2>ウィジェットとは</h2>
<p>ウィジェットとは、WordPressのテーマごとに用意されたサイト内のブロックを簡単に表示、非表示、並び替えたり出来る仕組みです。<br>
基本的なWordPressサイトのレイアウトは「ヘッダー」、「ボディ」、「サイドバー」、「フッター」というパーツ構成で成り立っています。<br>
それらのパーツの中にウィジェットエリアと言うブロックが用意され、その中に共通で表示させたいブロックや広告などを入れる事で簡単に管理できる仕組みになっています。
</p>
<h2>すぐに使える便利ウィジェットプラグイン</h2>
<h3>DD Last Viewed</h3>
<p>このプラグインはウィジェットに追加するだけで、最近見た記事の一覧表示が出来ます。<br>
最新何件表示するか、投稿ページの他に固定ページ等も表示するか、表示から除外したいページのIDを指定するかの簡単な指定だけをウィジェット上で行って使うのでとても簡単に利用できます。
</p>
<div class="reference_site_block">
<p class="reference_site_title">参考にしたサイト</p>
<a href="https://wordpress.org/plugins/dd-lastviewed/" target="_blank" rel="noopener">https://wordpress.org/plugins/dd-lastviewed/</a>
</div>

<h3>WordPress Popular Posts</h3>
<p>Popular Posts(人気の投稿)、と名前の通りです。<br>
サイト内でよく見られてる記事を人気順に、指定の個数、指定のカテゴリ、指定した期間等詳細な設定をした上で一覧をウィジェット表示させられます。<br>
簡単な割に細かい設定まで出来るので、カテゴリーページ毎に違う指定をさせたりも面白いかもですね。
</p>
<div class="reference_site_block">
<p class="reference_site_title">参考にしたサイト</p>
<a href="https://wordpress.org/plugins/wordpress-popular-posts/" target="_blank" rel="noopener">https://wordpress.org/plugins/wordpress-popular-posts/</a>
</div>

<h3>Advanced Random Posts Widget</h3>
<p>このプラグインを使うとウィジェットエリアにランダムの記事を表示させられます。<br>
人気の記事も見てもらいたいけど、あまり目に留まらないような記事にも目を向けてもらうと言った意味ではランダム表示も使い方次第では良いですね。
</p>
<div class="reference_site_block">
<p class="reference_site_title">参考にしたサイト</p>
<a href="https://wordpress.org/plugins/advanced-random-posts-widget/" target="_blank" rel="noopener">https://wordpress.org/plugins/advanced-random-posts-widget/</a>
</div>

<h3>Ajax Search Lite</h3>
<p>通常のWordPressの検索機能では、検索ボタンを押した後にアーカイブページに表示される形ですが、このプラグインを使えば別ページに遷移させずにその場で入力したテキストに沿った検索結果を表示させることが出来ます。</p>
<div class="reference_site_block">
<p class="reference_site_title">参考にしたサイト</p>
<a href="https://wordpress.org/plugins/ajax-search-lite/" target="_blank" rel="noopener">https://wordpress.org/plugins/ajax-search-lite/</a>
</div>
		<div class="wpulike wpulike-animated-heart " ><div class="wp_ulike_general_class wp_ulike_is_not_liked"><button type="button"
					aria-label="いいねボタン"
					data-ulike-id="183"
					data-ulike-nonce="a2b4582208"
					data-ulike-type="post"
					data-ulike-template="wpulike-animated-heart"
					data-ulike-display-likers=""
					data-ulike-likers-style="popover"
					data-ulike-append="&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop one&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop two&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop three&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop four&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop five&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop six&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop seven&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop eight&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop nine&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;"
					class="wp_ulike_btn wp_ulike_put_image wp_post_btn_183"><svg class="wpulike-svg-heart wpulike-svg-heart-icon" viewBox="0 -28 512.00002 512" xmlns="http://www.w3.org/2000/svg"><path
						d="m471.382812 44.578125c-26.503906-28.746094-62.871093-44.578125-102.410156-44.578125-29.554687 0-56.621094 9.34375-80.449218 27.769531-12.023438 9.300781-22.917969 20.679688-32.523438 33.960938-9.601562-13.277344-20.5-24.660157-32.527344-33.960938-23.824218-18.425781-50.890625-27.769531-80.445312-27.769531-39.539063 0-75.910156 15.832031-102.414063 44.578125-26.1875 28.410156-40.613281 67.222656-40.613281 109.292969 0 43.300781 16.136719 82.9375 50.78125 124.742187 30.992188 37.394531 75.535156 75.355469 127.117188 119.3125 17.613281 15.011719 37.578124 32.027344 58.308593 50.152344 5.476563 4.796875 12.503907 7.4375 19.792969 7.4375 7.285156 0 14.316406-2.640625 19.785156-7.429687 20.730469-18.128907 40.707032-35.152344 58.328125-50.171876 51.574219-43.949218 96.117188-81.90625 127.109375-119.304687 34.644532-41.800781 50.777344-81.4375 50.777344-124.742187 0-42.066407-14.425781-80.878907-40.617188-109.289063zm0 0" /></svg></button><span class="count-box wp_ulike_counter_up" data-ulike-counter-value=""></span>			</div></div><p>The post <a href="https://wapu-dou.com/post/183/">ウィジェット活用プラグイン4選</a> first appeared on <a href="https://wapu-dou.com">わぷ道</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://wapu-dou.com/post/183/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>【ESCキーで閉じる】モーダルウィンドウの実装方法</title>
		<link>https://wapu-dou.com/post/145/</link>
					<comments>https://wapu-dou.com/post/145/#comments</comments>
		
		<dc:creator><![CDATA[akkunday]]></dc:creator>
		<pubDate>Sun, 14 Aug 2022 03:53:24 +0000</pubDate>
				<category><![CDATA[ウェブ制作]]></category>
		<category><![CDATA[html/css]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[pickup]]></category>
		<guid isPermaLink="false">https://wapu-dou.com/?p=145</guid>

					<description><![CDATA[<p>モーダルウインドウの実装方法 HTML、CSS部分の作成 まずは、モーダルウィンドウを開くためのボタン、モーダルウィンドウ本体、オーバーレイ部分のパーツをそれぞれ作成していきます。 &#60;body&#62; &#60;div class=&#038;q…</p>
<p>The post <a href="https://wapu-dou.com/post/145/">【ESCキーで閉じる】モーダルウィンドウの実装方法</a> first appeared on <a href="https://wapu-dou.com">わぷ道</a>.</p>]]></description>
										<content:encoded><![CDATA[<h2>モーダルウインドウの実装方法</h2>

<h3>HTML、CSS部分の作成</h3>
<p>まずは、モーダルウィンドウを開くためのボタン、モーダルウィンドウ本体、オーバーレイ部分のパーツをそれぞれ作成していきます。</p>
<pre class="line-numbers"><code class="language-other">&lt;body&gt;
    &lt;div class=&quot;modal_open_btn&quot;&gt;開く&lt;/div&gt;
    &lt;div class=&quot;modal_window&quot;&gt;
        &lt;p&gt;モーダルウィンドウの中身です&lt;/p&gt;
        &lt;span class=&quot;modal_close&quot;&gt;×&lt;/span&gt;
    &lt;/div&gt;
    &lt;div class=&quot;modal_overlay&quot;&gt;&lt;/div&gt;
&lt;/body&gt;
</code></pre>

<h3>js部分の作成</h3>
<p>ここからはjs部分の作成になります。<br>
こちらはjQueryを利用しているのであらかじめjQueryを読み込んでることを確認してください。
</p>

<h4>js部分1</h4>
<p>モーダルウィンドウの表示と、bodyに対してoverflow:hiddenをかける事でモーダルウィンドウを開いている際に、スクロール出来ないように指定します。</p>
<pre class="line-numbers"><code class="language-js">$('.modal_open_btn').click(function () {
      $('body').addClass('scroll_lock'); 
        $('.modal_overlay').fadeIn();
        $('.modal_window').fadeIn();        
});
</code></pre>
<h4>js部分2</h4>
<p>閉じるボタン、オーバーレイ部分をクリックした際に、モーダルウィンドウの非表示と、先ほど指定したスクロールの固定を解除します。</p>
<pre class="line-numbers"><code class="language-js">$('.modal_close , .modal_overlay').click(function () {
      $('body').removeClass('scroll_lock'); 
      $('.modal_overlay').fadeOut();
      $('.modal_window').fadeOut();
});
</code></pre>
<h4>js部分3</h4>
<p>ESCキーを押した時に、閉じるボタンを押した時と同様の動作をするように指定しています。</p>
<pre class="line-numbers"><code class="language-js">window.onkeyup = function(event){
    if(event.keyCode == '27'){
        $('body').removeClass('scroll_lock'); 
        $('.modal_overlay').fadeOut();
        $('.modal_window').fadeOut();
    }
}
</code></pre>
<div class="voice clearfix right n_bottom"><div class="icon"><img decoding="async" src="https://wapu-dou.com/wp-content/uploads/2022/08/comment_icon1.png"><div class="name">わぷまる</div></div><div class="text sc_balloon right white" >「keyCode == '27'」の部分で、ESCキーを指定しているので、ここの数字を変更する事で他のキーを指定することも出来るよ</div></div>
<div class="reference_site_block">
<p class="reference_site_title">参考にしたサイト</p>
<a href="https://web-designer.cman.jp/javascript_ref/keyboard/keycode/" target="_blank" rel="noopener">https://web-designer.cman.jp/javascript_ref/keyboard/keycode/</a>
</div>

<h4>全部まとめたのがこちら</h4>
<pre class="line-numbers"><code class="language-js">$(function () {
    $('.modal_open_btn').click(function () {
        $('body').addClass('scroll_lock'); 
        $('.modal_overlay').fadeIn();
        $('.modal_window').fadeIn(); 
        
    });
    $('.modal_close , .modal_overlay').click(function () {
        $('body').removeClass('scroll_lock'); 
        $('.modal_overlay').fadeOut();
        $('.modal_window').fadeOut();
    });
    window.onkeyup = function(event){
        if(event.keyCode == '27'){
            $('body').removeClass('scroll_lock'); 
            $('.modal_overlay').fadeOut();
            $('.modal_window').fadeOut();
        }
    }
});</code></pre>
<div class="coution_block">
<p class="coution_block_text">WordPressで上手く動かない場合、「$」を全部「jQuery」に置換する事で正常に動作する場合があります。</p>
</div>

		<div class="wpulike wpulike-animated-heart " ><div class="wp_ulike_general_class wp_ulike_is_not_liked"><button type="button"
					aria-label="いいねボタン"
					data-ulike-id="145"
					data-ulike-nonce="635306c9fe"
					data-ulike-type="post"
					data-ulike-template="wpulike-animated-heart"
					data-ulike-display-likers=""
					data-ulike-likers-style="popover"
					data-ulike-append="&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop one&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop two&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop three&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop four&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop five&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop six&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop seven&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop eight&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;&lt;svg class=&quot;wpulike-svg-heart wpulike-svg-heart-pop nine&quot; viewBox=&quot;0 0 32 29.6&quot;&gt;&lt;path d=&quot;M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z&quot;/&gt;&lt;/svg&gt;"
					class="wp_ulike_btn wp_ulike_put_image wp_post_btn_145"><svg class="wpulike-svg-heart wpulike-svg-heart-icon" viewBox="0 -28 512.00002 512" xmlns="http://www.w3.org/2000/svg"><path
						d="m471.382812 44.578125c-26.503906-28.746094-62.871093-44.578125-102.410156-44.578125-29.554687 0-56.621094 9.34375-80.449218 27.769531-12.023438 9.300781-22.917969 20.679688-32.523438 33.960938-9.601562-13.277344-20.5-24.660157-32.527344-33.960938-23.824218-18.425781-50.890625-27.769531-80.445312-27.769531-39.539063 0-75.910156 15.832031-102.414063 44.578125-26.1875 28.410156-40.613281 67.222656-40.613281 109.292969 0 43.300781 16.136719 82.9375 50.78125 124.742187 30.992188 37.394531 75.535156 75.355469 127.117188 119.3125 17.613281 15.011719 37.578124 32.027344 58.308593 50.152344 5.476563 4.796875 12.503907 7.4375 19.792969 7.4375 7.285156 0 14.316406-2.640625 19.785156-7.429687 20.730469-18.128907 40.707032-35.152344 58.328125-50.171876 51.574219-43.949218 96.117188-81.90625 127.109375-119.304687 34.644532-41.800781 50.777344-81.4375 50.777344-124.742187 0-42.066407-14.425781-80.878907-40.617188-109.289063zm0 0" /></svg></button><span class="count-box wp_ulike_counter_up" data-ulike-counter-value="+3"></span>			</div></div><p>The post <a href="https://wapu-dou.com/post/145/">【ESCキーで閉じる】モーダルウィンドウの実装方法</a> first appeared on <a href="https://wapu-dou.com">わぷ道</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://wapu-dou.com/post/145/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
	</channel>
</rss>
