<?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>php - わぷ道</title>
	<atom:link href="https://wapu-dou.com/post/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>https://wapu-dou.com</link>
	<description>主にWordPressで日々詰まったことなど、解決した際の備忘録として残していきたいと思い、作成しました。 そのほかにも、役立つ情報なんかを書いていければと思います。</description>
	<lastBuildDate>Fri, 03 Feb 2023 06:24:13 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.2</generator>
	<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="bf468869f5"
					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>投稿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="4ec0c3a152"
					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 fetchpriority="high" 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="7cc99bf428"
					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="a0cdfd55ad"
					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>【いいねボタン】WP Ulikeでいいねされた数を一覧に表示する方法</title>
		<link>https://wapu-dou.com/post/224/</link>
					<comments>https://wapu-dou.com/post/224/#respond</comments>
		
		<dc:creator><![CDATA[akkunday]]></dc:creator>
		<pubDate>Thu, 25 Aug 2022 14:12:47 +0000</pubDate>
				<category><![CDATA[ウェブ制作]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[プラグイン]]></category>
		<guid isPermaLink="false">https://wapu-dou.com/?p=224</guid>

					<description><![CDATA[<p>いいねボタンを設置する事が出来るプラグイン、「WP ULike」を使った際に、トップページやアーカイブページなど記事の外にも「いいね数」を表示させようとこちらの対応をしました。 いいね数の表示方法 今回はいいね数の表示と一緒に、いいね数の値…</p>
<p>The post <a href="https://wapu-dou.com/post/224/">【いいねボタン】WP Ulikeでいいねされた数を一覧に表示する方法</a> first appeared on <a href="https://wapu-dou.com">わぷ道</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>いいねボタンを設置する事が出来るプラグイン、「WP ULike」を使った際に、トップページやアーカイブページなど記事の外にも「いいね数」を表示させようとこちらの対応をしました。</p>

<h2>いいね数の表示方法</h2>
<p>今回はいいね数の表示と一緒に、いいね数の値に応じてクラスを付与する事で、たくさんいいねを押されてる記事を強調出来るように指定してみました。<br>
いいね数が100以下の時に「low_color」、101～200の時に「middle_color」、201以上の時には「high_color」と指定し、CSSでそれぞれに色指定をしています。
</p>

<h3>php</h3>
<pre class="line-numbers"><code class="language-php">&lt;?php
if(wp_ulike_get_post_likes($post-&gt;ID) &lt;= 100){
    $class_good = &quot;low_color&quot;;
}elseif(wp_ulike_get_post_likes($post-&gt;ID) &lt;= 200){
    $class_good = &quot;middle_color&quot;;
}elseif(wp_ulike_get_post_likes($post-&gt;ID) &gt;= 201){
    $class_good = &quot;high_color&quot;;
}
echo &#039;&lt;div class=&quot;good_count &#039;.$class_good.&#039;&quot;&gt;&#039;. wp_ulike_get_post_likes($post-&gt;ID) .&#039;&lt;/div&gt;&#039;;
?&gt;
</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" >前半のif部分で100以下の場合、200以下の場合、201以上の場合を指定しているので、調整して使ってくださいね</div></div>

<h3>CSS</h3>
<pre class="line-numbers"><code class="language-css">.good_count:before{
    content:url(/wp-content/plugins/wp-ulike/assets/img/svg/like.svg);
}
.low_color{
    filter: invert(72%) sepia(26%) saturate(63%) hue-rotate(1deg) brightness(105%) contrast(102%);
}
.middle_color{
    filter: invert(72%) sepia(26%) saturate(6428%) hue-rotate(1deg) brightness(105%) contrast(102%);
}
.high_color{
    filter: invert(15%) sepia(95%) saturate(6932%) hue-rotate(358deg) brightness(95%) contrast(112%);
}
</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" >CSSは、filterを使ってグッドアイコンと、いいね数に色を付けています<br>プラグインに元々入っているアイコンを使っているためこのような方法で対応していますが、お好みでアレンジしてみてくださいね</div></div>
<div class="reference_site_block">
<p class="reference_site_title">参考にしたサイト</p>
<a href="https://ja.wordpress.org/plugins/wp-ulike/" target="_blank" rel="noopener">https://ja.wordpress.org/plugins/wp-ulike/</a>
</div>
<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/229/"><img decoding="async" src="https://wapu-dou.com/wp-content/uploads/2022/08/thumbnail_229.png"></a></div><div class="together_post_flex_text_inner"><p class="together_post_title"><a href="https://wapu-dou.com/post/229/">【いいねボタン】プラグインで簡単！いいねボタンを設置する方法</a></p><time class="together_post_date" datatime="2022-08-27">2022年8月27日</time><a href="https://wapu-dou.com/post/tag/pickup/" class="together_tag">pickup</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="224"
					data-ulike-nonce="3441d83bd4"
					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_224"><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/224/">【いいねボタン】WP Ulikeでいいねされた数を一覧に表示する方法</a> first appeared on <a href="https://wapu-dou.com">わぷ道</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://wapu-dou.com/post/224/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/RmSE0eFZ26o" 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/2TDZVjlV8F8" 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/XvKQJRhus74" 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="dea0564d53"
					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>日付の表示を〇時間前、〇日前に変える方法</title>
		<link>https://wapu-dou.com/post/189/</link>
					<comments>https://wapu-dou.com/post/189/#respond</comments>
		
		<dc:creator><![CDATA[akkunday]]></dc:creator>
		<pubDate>Thu, 18 Aug 2022 08:01:15 +0000</pubDate>
				<category><![CDATA[ウェブ制作]]></category>
		<category><![CDATA[php]]></category>
		<guid isPermaLink="false">https://wapu-dou.com/?p=189</guid>

					<description><![CDATA[<p>ブログの公開日の表示を〇〇年〇月〇日の表示から、〇時間前、〇日前の表示に変更したいと思う事はありませんか？ 今回は、3日前までの投稿までは〇時間、〇日前の表記にして、それ以前の記事は〇〇年〇月〇日という表記にしてみました。 実装方法 「si…</p>
<p>The post <a href="https://wapu-dou.com/post/189/">日付の表示を〇時間前、〇日前に変える方法</a> first appeared on <a href="https://wapu-dou.com">わぷ道</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>ブログの公開日の表示を〇〇年〇月〇日の表示から、〇時間前、〇日前の表示に変更したいと思う事はありませんか？<br>
今回は、3日前までの投稿までは〇時間、〇日前の表記にして、それ以前の記事は〇〇年〇月〇日という表記にしてみました。</p>

<h2>実装方法</h2>
<p>「single.php」や「index.php」、「archives.php」等の日付を表示させてる箇所を下記のように書き換えます。</p>

<pre class="line-numbers"><code class="language-php">&lt;?php if(get_theme_mod(&#039;post_date&#039;,true)): ?&gt;
&lt;time datetime=&quot;&lt;?php echo (get_theme_mod(&#039;post_sort&#039;,&#039;published&#039;)==&#039;published&#039;)?the_time(&#039;Y-m-d&#039;):the_modified_date(&#039;Y-m-d&#039;); ?&gt;&quot; class=&quot;post-date&quot;&gt;
&lt;?php 
    if(date(&#039;U&#039;) - get_the_time(&#039;U&#039;) &lt; 60*60*72){
        echo human_time_diff( get_the_time(&#039;U&#039;), current_time(&#039;timestamp&#039;) ) . &#039;前&#039;;
    }else{
        echo(get_theme_mod(&#039;post_sort&#039;,&#039;published&#039;)==&#039;published&#039;)?get_the_date():the_modified_date(&#039;Y年m月d日&#039;);
    } 
?&gt;
&lt;/time&gt;
&lt;?php endif; ?&gt;</code></pre>
<h2>表記変更タイミングの指定方法</h2>
<p>下記のif文で公開後の時間を判定して、表記を変更しています。<br>
60(秒)*60(分)*72(時間)で3日間と指定しているため、ここの数値を変更する事で、指定時間を変更出来ます。
</p>
<pre class="line-numbers"><code class="language-php">if(date(&#039;U&#039;) - get_the_time(&#039;U&#039;) &lt; 60*60*72)</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_icon2.png"><div class="name">ぺんぎん</div></div><div class="text sc_balloon left white" >全部を〇時間前みたいな表記にした時の表記はそれぞれどうなるの？</div></div>
<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" >基本的にはこのように表示されるよ<br><br><br>分　：1時間未満の場合<br>時間：1時間以上24時間未満の場合<br>日　：24時間以上7日未満の場合<br>週間：7日以上30日未満の場合<br>か月：30日以上365日未満の場合<br>年　：365日以上の場合<br></div></div>

<div class="coution_block">
<p class="coution_block_text">human_time_diff関数は、時間を相対的に表示させる為の関数ですが、phpを使って表記を変更する事が出来るため、WordPressのバージョンや、テーマの仕様によって上記の表記と異なる場合があります。</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="189"
					data-ulike-nonce="9aa4c05a6e"
					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_189"><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/189/">日付の表示を〇時間前、〇日前に変える方法</a> first appeared on <a href="https://wapu-dou.com">わぷ道</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://wapu-dou.com/post/189/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>指定したウィジェットのタイトルを非表示にする方法</title>
		<link>https://wapu-dou.com/post/176/</link>
					<comments>https://wapu-dou.com/post/176/#respond</comments>
		
		<dc:creator><![CDATA[akkunday]]></dc:creator>
		<pubDate>Tue, 16 Aug 2022 08:22:57 +0000</pubDate>
				<category><![CDATA[ウェブ制作]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[ウィジェット]]></category>
		<guid isPermaLink="false">https://wapu-dou.com/?p=176</guid>

					<description><![CDATA[<p>WordPressのサイドバーなどのウィジェットエリア。 タイトルを表示したいウィジェットと、タイトルを表示したくないウィジェットがあったりしませんか？ ウィジェットのタイトルをそもそも入力しなければ、表示はされませんが、見た目的に何のウィ…</p>
<p>The post <a href="https://wapu-dou.com/post/176/">指定したウィジェットのタイトルを非表示にする方法</a> first appeared on <a href="https://wapu-dou.com">わぷ道</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>WordPressのサイドバーなどのウィジェットエリア。
タイトルを表示したいウィジェットと、タイトルを表示したくないウィジェットがあったりしませんか？

ウィジェットのタイトルをそもそも入力しなければ、表示はされませんが、見た目的に何のウィジェットなのかわかりづらくなってしまう。
そう思った時に調べて出てきた方法がとても参考になったので紹介したいと思います。
</p>

<h2>指定したウィジェットのみタイトルを非表示にする</h2>
<p>下記のソースをWordPressの<strong>functions.php</strong>に追記する事で、特定のウィジェットのみタイトルを非表示にする事ができます。</p>
<pre class="line-numbers"><code class="language-php">add_filter( 'widget_title', 'remove_widget_title' );
function remove_widget_title( $widget_title ) {
  if ( substr ( $widget_title, 0, 1 ) == '!' )
    return;
  else 
    return ( $widget_title );
}
</code></pre>

<h2>ウィジェットの指定方法</h2>
<p>上記phpを設置した後、通常通りウィジェットを作成する際にウィジェットのタイトルの先頭に「!」を入れる事でウィジェットにタイトルが出てこないようになります。</p>
<img decoding="async" src="https://wapu-dou.com/wp-content/uploads/2022/08/wapu-dou-ss1-239x300.png" alt="" width="239" height="300" class="alignnone size-medium wp-image-177" srcset="https://wapu-dou.com/wp-content/uploads/2022/08/wapu-dou-ss1-239x300.png 239w, https://wapu-dou.com/wp-content/uploads/2022/08/wapu-dou-ss1.png 441w" sizes="(max-width: 239px) 100vw, 239px" />

<div class="reference_site_block">
<p class="reference_site_title">参考にしたサイト</p>
<a href="https://webllica.com/wordpress-remove-widget-titles/" target="_blank" rel="noopener">https://webllica.com/wordpress-remove-widget-titles/</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="176"
					data-ulike-nonce="335fc88acd"
					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_176"><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/176/">指定したウィジェットのタイトルを非表示にする方法</a> first appeared on <a href="https://wapu-dou.com">わぷ道</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://wapu-dou.com/post/176/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
