<?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>excerpt  |  塞翁失馬</title>
	<atom:link href="https://hbirds.mydns.jp/tag/excerpt/feed/" rel="self" type="application/rss+xml" />
	<link>https://hbirds.mydns.jp</link>
	<description>禍福は糾える縄の如し</description>
	<lastBuildDate>Tue, 27 Dec 2022 08:57:00 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.6.2</generator>

<image>
	<url>https://hbirds.mydns.jp/wp-content/uploads/2022/12/cropped-akaza-32x32.png</url>
	<title>excerpt  |  塞翁失馬</title>
	<link>https://hbirds.mydns.jp</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>フロントページを抜粋表示</title>
		<link>https://hbirds.mydns.jp/%e3%83%95%e3%83%ad%e3%83%b3%e3%83%88%e3%83%9a%e3%83%bc%e3%82%b8%e3%82%92%e6%8a%9c%e7%b2%8b%e8%a1%a8%e7%a4%ba/</link>
		
		<dc:creator><![CDATA[hbirds]]></dc:creator>
		<pubDate>Sun, 25 Dec 2022 21:48:35 +0000</pubDate>
				<category><![CDATA[WEB]]></category>
		<category><![CDATA[excerpt]]></category>
		<guid isPermaLink="false">http://hbirds.mydns.jp/?p=175</guid>

					<description><![CDATA[現在、デフォルトのテーマである２０２３を使っているが、フロントページに各投稿が全文表示されるようになっている。抜粋表示するようにカスタマイズしたい。 参考サイトは、こちら。 具体的には、フロントページを表示するPHPをテーマファイルから探し出して、参考サイトのコードを埋め込んで全文→抜粋表示するように改変すれば良いと思われるが・・・。]]></description>
										<content:encoded><![CDATA[
<p>現在、デフォルトのテーマである２０２３を使っているが、フロントページに各投稿が全文表示されるようになっている。抜粋表示するようにカスタマイズしたい。</p>



<p>参考サイトは、<a rel="noopener" href="https://qeynos2525.blog.jp/archives/1079553680.html" target="_blank">こちら</a>。</p>



<p>具体的には、フロントページを表示するPHPをテーマファイルから探し出して、参考サイトのコードを埋め込んで全文→抜粋表示するように改変すれば良いと思われるが・・・。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-php" data-lang="PHP"><code>&lt;?php // 抜粋を文字数制限をかけて表示
  $excerpt_num = 72; // 制限をかけるバイト数を指定 全角＝2バイト 半角＝1バイト
  $post_excerpt = strip_tags(get_the_excerpt()); // 抜粋を取得
  if(mb_strlen($post_excerpt)&gt;$excerpt_num ) { // 抜粋が指定したバイト数より多い時に TRUE
    $content = mb_substr($post_excerpt,0,$excerpt_num); // 同じバイト数を指定
    echo str_replace(array(&quot;\r&quot;, &quot;\n&quot;), &#39;&#39;, $content).･･･; // 改行の削除、末尾に「...」を追加
  } else {
    echo str_replace(array(&quot;\r&quot;, &quot;\n&quot;), &#39;&#39;, $post_excerpt); // 改行の削除
  }
?&gt;</code></pre></div>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
