{"id":2807,"date":"2014-08-04T17:39:29","date_gmt":"2014-08-04T08:39:29","guid":{"rendered":"http:\/\/apr20.net\/?p=2807"},"modified":"2014-08-04T17:39:29","modified_gmt":"2014-08-04T08:39:29","slug":"wordpress%e3%81%ae%e3%83%91%e3%83%b3%e3%81%8f%e3%81%9a%e3%83%aa%e3%82%b9%e3%83%88%e3%82%92microdata%e5%af%be%e5%bf%9c%e3%81%95%e3%81%9b%e3%82%8b","status":"publish","type":"post","link":"https:\/\/apr20.net\/?p=2807","title":{"rendered":"wordpress\u306e\u30d1\u30f3\u304f\u305a\u30ea\u30b9\u30c8\u3092microdata\u5bfe\u5fdc\u3055\u305b\u308b[\u8ffd\u8a18\u3042\u308a]"},"content":{"rendered":"<p>WordPress\u306e\u30d1\u30f3\u304f\u305a\u30ea\u30b9\u30c8\u3092\u30ea\u30c3\u30c1\u30b9\u30cb\u30da\u30c3\u30c8(microdata)\u306b\u5bfe\u5fdc\u3055\u305b\u3066\u307f\u307e\u3057\u305f\u3002<br \/>\n<br \/>\n\u30ea\u30c3\u30c1\u30b9\u30cb\u30da\u30c3\u30c8\u306b\u3064\u3044\u3066\u306f\u4e0b\u8a18\u3092\u53c2\u8003\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n<a href=\"https:\/\/support.google.com\/webmasters\/answer\/185417?hl=ja\" target=\"_blank\">\u30ea\u30c3\u30c1 \u30b9\u30cb\u30da\u30c3\u30c8 &#8211; \u30d1\u30f3\u304f\u305a\u30ea\u30b9\u30c8(Google)<\/a><\/p>\n<p>\u5bfe\u5fdc\u5f8c\u306e\u30b3\u30fc\u30c9\u306fGist\u306b\u3042\u308a\u307e\u3059\u3002\u3068\u3044\u3046\u5272\u306b\u3001Gist\u306e\u4f7f\u3044\u65b9\u304c\u3088\u304f\u308f\u304b\u3063\u3066\u3044\u307e\u305b\u3093\u30fb\u30fb\u3002<br \/>\n\u5c11\u3057\u305a\u3064\u52c9\u5f37\u3057\u3066\u3044\u304d\u307e\u3059\u3002(^_^;)<\/p>\n<p><a href=\"https:\/\/gist.github.com\/apr20\/f83048c886d795cf3fd5\" target=\"_blank\">microdata\u5bfe\u5fdc\u306eWordpress\u7528\u30d1\u30f3\u304f\u305a\u30ea\u30b9\u30c8(Gist)<\/a><\/p>\n<p>[php]<br \/>\n&lt;?php<br \/>\nfunction breadcrumb($divOption = array(&quot;id&quot; =&gt; &quot;breadcrumb&quot;, &quot;class&quot; =&gt; &quot;clearfix&quot;)){<br \/>\n\tglobal $post;<br \/>\n\t$str =&#8221;;<br \/>\n\tif(!is_home()&amp;&amp;!is_admin()){ \/* !is_admin \u306f\u7ba1\u7406\u30da\u30fc\u30b8\u4ee5\u5916\u3068\u3044\u3046\u6761\u4ef6\u5206\u5c90 *\/<br \/>\n\t\t$tagAttribute = &#8221;;<br \/>\n\t\tforeach($divOption as $attrName =&gt; $attrValue){<br \/>\n\t\t\t$tagAttribute .= sprintf(&#8216; %s=&quot;%s&quot;&#8217;, $attrName, $attrValue);<br \/>\n\t\t}<br \/>\n\t\t$str.= &#8216;&lt;div&#8217;. $tagAttribute .&#8217;&gt;&#8217;;<br \/>\n\t\t$str.= &#8216;&lt;ul&gt;&#8217;;<br \/>\n\t\t$str.= &#8216;&lt;li itemscope itemtype=&quot;http:\/\/data-vocabulary.org\/Breadcrumb&quot;&gt;&lt;a href=&quot;&#8217;. home_url() .&#8217;\/&quot; itemprop=&quot;url&quot;&gt;&lt;span itemprop=&quot;title&quot;&gt;\u30db\u30fc\u30e0&lt;\/span&gt;&lt;\/a&gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t$str.= &#8216;&lt;li&gt;&amp;gt;&lt;\/li&gt;&#8217;;<\/p>\n<p>\t\tif(is_category()) {\t\t\t\t\t\t\t\t\/\/\u30ab\u30c6\u30b4\u30ea\u30fc\u306e\u30a2\u30fc\u30ab\u30a4\u30d6\u30da\u30fc\u30b8<br \/>\n\t\t\t$cat = get_queried_object();<br \/>\n\t\t\tif($cat -&gt; parent != 0){<br \/>\n\t\t\t\t$ancestors = array_reverse(get_ancestors( $cat -&gt; cat_ID, &#8216;category&#8217; ));<br \/>\n\t\t\t\tforeach($ancestors as $ancestor){<br \/>\n\t\t\t\t\t$str.='&lt;li itemscope itemtype=&quot;http:\/\/data-vocabulary.org\/Breadcrumb&quot;&gt;&lt;a href=&quot;&#8217;. get_category_link($ancestor) .&#8217;&quot; itemprop=&quot;url&quot;&gt;&lt;span itemprop=&quot;title&quot;&gt;&#8217;. get_cat_name($ancestor) .'&lt;\/span&gt;&lt;\/a&gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t\t\t\t$str.='&lt;li&gt;&amp;gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t\t\t}<br \/>\n\t\t\t}<br \/>\n\t\t\t$str.='&lt;li itemscope itemtype=&quot;http:\/\/data-vocabulary.org\/Breadcrumb&quot;&gt;&lt;a href=&quot;&#8217;. get_category_link($cat -&gt; cat_ID) .&#8217;&quot; itemprop=&quot;url&quot;&gt;&lt;span itemprop=&quot;title&quot;&gt;&#8217;. $cat -&gt; name . &#8216;&lt;\/span&gt;&lt;\/a&gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t} elseif(is_single()){\t\t\t\t\t\t\t\/\/\u30d6\u30ed\u30b0\u306e\u500b\u5225\u8a18\u4e8b\u30da\u30fc\u30b8<br \/>\n\t\t\t$categories = get_the_category($post-&gt;ID);<br \/>\n\t\t\t$cat = $categories[0];<br \/>\n\t\t\tif($cat -&gt; parent != 0){<br \/>\n\t\t\t\t$ancestors = array_reverse(get_ancestors( $cat -&gt; cat_ID, &#8216;category&#8217; ));<br \/>\n\t\t\t\tforeach($ancestors as $ancestor){<br \/>\n\t\t\t\t\t$str.='&lt;li itemscope itemtype=&quot;http:\/\/data-vocabulary.org\/Breadcrumb&quot;&gt;&lt;a href=&quot;&#8217;. get_category_link($ancestor).&#8217;&quot; itemprop=&quot;url&quot;&gt;&lt;span itemprop=&quot;title&quot;&gt;&#8217;. get_cat_name($ancestor). &#8216;&lt;\/span&gt;&lt;\/a&gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t\t\t\t$str.='&lt;li&gt;&amp;gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t\t\t}<br \/>\n\t\t\t}<br \/>\n\t\t\t$str.='&lt;li itemscope itemtype=&quot;http:\/\/data-vocabulary.org\/Breadcrumb&quot;&gt;&lt;a href=&quot;&#8217;. get_category_link($cat -&gt; term_id). &#8216;&quot; itemprop=&quot;url&quot;&gt;&lt;span itemprop=&quot;title&quot;&gt;&#8217;. $cat-&gt; cat_name . &#8216;&lt;\/span&gt;&lt;\/a&gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t\t$str.='&lt;li&gt;&amp;gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t\t$str.= &#8216;&lt;li itemscope itemtype=&quot;http:\/\/data-vocabulary.org\/Breadcrumb&quot;&gt;&lt;a href=&quot;&#8217;.get_permalink($post-&gt;ID).&#8217;&quot; itemprop=&quot;url&quot;&gt;&lt;span itemprop=&quot;title&quot;&gt;&#8217;. $post -&gt; post_title .'&lt;\/span&gt;&lt;\/a&gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t} elseif(is_page()){\t\t\t\t\t\t\t\/\/\u56fa\u5b9a\u30da\u30fc\u30b8<br \/>\n\t\t\tif($post -&gt; post_parent != 0 ){<br \/>\n\t\t\t\t$ancestors = array_reverse(get_post_ancestors( $post-&gt;ID ));<br \/>\n\t\t\t\tforeach($ancestors as $ancestor){<br \/>\n\t\t\t\t\t$str.='&lt;li itemscope itemtype=&quot;http:\/\/data-vocabulary.org\/Breadcrumb&quot;&gt;&lt;a href=&quot;&#8217;. get_permalink($ancestor).&#8217;&quot; itemprop=&quot;url&quot;&gt;&lt;span itemprop=&quot;title&quot;&gt;&#8217;. get_the_title($ancestor) .'&lt;\/span&gt;&lt;\/a&gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t\t\t\t$str.='&lt;li&gt;&amp;gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t\t\t}<br \/>\n\t\t\t}<br \/>\n\t\t\t$str.= &#8216;&lt;li itemscope itemtype=&quot;http:\/\/data-vocabulary.org\/Breadcrumb&quot;&gt;&lt;a href=&quot;&#8217;.get_permalink($post-&gt;ID).&#8217;&quot; itemprop=&quot;url&quot;&gt;&lt;span itemprop=&quot;title&quot;&gt;&#8217;. $post -&gt; post_title .'&lt;\/span&gt;&lt;\/a&gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t} elseif(is_date()){\t\t\t\t\t\t\t\/\/\u65e5\u4ed8\u30d9\u30fc\u30b9\u306e\u30a2\u30fc\u30ab\u30a4\u30d6\u30da\u30fc\u30b8<br \/>\n\t\t\tif(get_query_var(&#8216;day&#8217;) != 0){\t\t\t\t\/\/\u5e74\u5225\u30a2\u30fc\u30ab\u30a4\u30d6<br \/>\n\t\t\t\t$str.='&lt;li itemscope itemtype=&quot;http:\/\/data-vocabulary.org\/Breadcrumb&quot;&gt;&lt;a href=&quot;&#8217;. get_year_link(get_query_var(&#8216;year&#8217;)). &#8216;&quot; itemprop=&quot;url&quot;&gt;&lt;span itemprop=&quot;title&quot;&gt;&#8217; . get_query_var(&#8216;year&#8217;). &#8216;\u5e74&lt;\/span&gt;&lt;\/a&gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t\t\t$str.='&lt;li&gt;&amp;gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t\t\t$str.='&lt;li itemscope itemtype=&quot;http:\/\/data-vocabulary.org\/Breadcrumb&quot;&gt;&lt;a href=&quot;&#8217;. get_month_link(get_query_var(&#8216;year&#8217;), get_query_var(&#8216;monthnum&#8217;)). &#8216;&quot; itemprop=&quot;url&quot;&gt;&lt;span itemprop=&quot;title&quot;&gt;&#8217;. get_query_var(&#8216;monthnum&#8217;) .&#8217;\u6708&lt;\/span&gt;&lt;\/a&gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t\t\t$str.='&lt;li&gt;&amp;gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t\t\t$str.='&lt;li itemscope itemtype=&quot;http:\/\/data-vocabulary.org\/Breadcrumb&quot;&gt;&lt;a href=&quot;&#8217;. get_day_link(get_query_var(&#8216;year&#8217;), get_query_var(&#8216;monthnum&#8217;), get_query_var(&#8216;day&#8217;)) .&#8217;&quot; itemprop=&quot;url&quot;&gt;&lt;span itemprop=&quot;title&quot;&gt;&#8217;. get_query_var(&#8216;day&#8217;). &#8216;\u65e5&lt;\/span&gt;&lt;\/a&gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t\t} elseif(get_query_var(&#8216;monthnum&#8217;) != 0){\t\/\/\u6708\u5225\u30a2\u30fc\u30ab\u30a4\u30d6<br \/>\n\t\t\t\t$str.='&lt;li itemscope itemtype=&quot;http:\/\/data-vocabulary.org\/Breadcrumb&quot;&gt;&lt;a href=&quot;&#8217;. get_year_link(get_query_var(&#8216;year&#8217;)) .&#8217;&quot; itemprop=&quot;url&quot;&gt;&lt;span itemprop=&quot;title&quot;&gt;&#8217;. get_query_var(&#8216;year&#8217;) .&#8217;\u5e74&lt;\/span&gt;&lt;\/a&gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t\t\t$str.='&lt;li&gt;&amp;gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t\t\t$str.='&lt;li itemscope itemtype=&quot;http:\/\/data-vocabulary.org\/Breadcrumb&quot;&gt;&lt;a href=&quot;&#8217;. get_month_link(get_query_var(&#8216;year&#8217;), get_query_var(&#8216;monthnum&#8217;)) .&#8217;&quot; itemprop=&quot;url&quot;&gt;&lt;span itemprop=&quot;title&quot;&gt;&#8217;. get_query_var(&#8216;monthnum&#8217;). &#8216;\u6708&lt;\/span&gt;&lt;\/a&gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t\t} else {\t\t\t\t\t\t\t\t\t\/\/\u5e74\u5225\u30a2\u30fc\u30ab\u30a4\u30d6<br \/>\n\t\t\t\t$str.='&lt;li itemscope itemtype=&quot;http:\/\/data-vocabulary.org\/Breadcrumb&quot;&gt;&lt;a href=&quot;&#8217;. get_year_link(get_query_var(&#8216;year&#8217;)) .&#8217;&quot; itemprop=&quot;url&quot;&gt;&lt;span itemprop=&quot;title&quot;&gt;&#8217;. get_query_var(&#8216;year&#8217;) .&#8217;\u5e74&lt;\/span&gt;&lt;\/a&gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t\t}<br \/>\n\t\t} elseif(is_search()) {\t\t\t\t\t\t\t\/\/\u691c\u7d22\u7d50\u679c\u8868\u793a\u30da\u30fc\u30b8<br \/>\n\t\t\t$str.='&lt;li itemscope itemtype=&quot;http:\/\/data-vocabulary.org\/Breadcrumb&quot;&gt;&lt;a href=&quot;&#8217;.get_bloginfo(&#8216;url&#8217;).&#8217;\/?&#8217;.$_SERVER[&#8216;QUERY_STRING&#8217;].&#8217;&quot; itemprop=&quot;url&quot;&gt;&lt;span itemprop=&quot;title&quot;&gt;\u300c&#8217;. get_search_query() .&#8217;\u300d\u306e\u691c\u7d22\u7d50\u679c&lt;\/span&gt;&lt;\/a&gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t} elseif(is_author()){\t\t\t\t\t\t\t\/\/\u6295\u7a3f\u8005\u306e\u30a2\u30fc\u30ab\u30a4\u30d6\u30da\u30fc\u30b8<br \/>\n\t\t\t$str .='&lt;li itemscope itemtype=&quot;http:\/\/data-vocabulary.org\/Breadcrumb&quot;&gt;&lt;a href=&quot;&#8217;.get_author_posts_url(get_query_var(&#8216;author&#8217;)).&#8217;&quot; itemprop=&quot;url&quot;&gt;&lt;span itemprop=&quot;title&quot;&gt;\u6295\u7a3f\u8005 : &#8216;. get_the_author_meta(&#8216;display_name&#8217;, get_query_var(&#8216;author&#8217;)).'&lt;\/span&gt;&lt;\/a&gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t} elseif(is_tag()){\t\t\t\t\t\t\t\t\/\/\u30bf\u30b0\u306e\u30a2\u30fc\u30ab\u30a4\u30d6\u30da\u30fc\u30b8<br \/>\n\t\t\t$str.='&lt;li itemscope itemtype=&quot;http:\/\/data-vocabulary.org\/Breadcrumb&quot;&gt;&lt;a href=&quot;&#8217;.get_tag_link(get_query_var(&#8216;tag_id&#8217;)).&#8217;&quot; itemprop=&quot;url&quot;&gt;&lt;span itemprop=&quot;title&quot;&gt;\u30bf\u30b0 : &#8216;. single_tag_title( &#8221; , false ). &#8216;&lt;\/span&gt;&lt;\/a&gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t} elseif(is_attachment()){\t\t\t\t\t\t\/\/\u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\u30da\u30fc\u30b8<br \/>\n\t\t\t$str.= &#8216;&lt;li itemscope itemtype=&quot;http:\/\/data-vocabulary.org\/Breadcrumb&quot;&gt;&lt;span itemprop=&quot;title&quot;&gt;&#8217;. $post -&gt; post_title .'&lt;\/span&gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t} elseif(is_404()){\t\t\t\t\t\t\t\t\/\/404 Not Found \u30da\u30fc\u30b8<br \/>\n\t\t\t$str.='&lt;li itemscope itemtype=&quot;http:\/\/data-vocabulary.org\/Breadcrumb&quot;&gt;&lt;span itemprop=&quot;title&quot;&gt;404 Not found&lt;\/span&gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t} else{\t\t\t\t\t\t\t\t\t\t\t\/\/\u305d\u306e\u4ed6<br \/>\n\t\t\t$str.='&lt;li itemscope itemtype=&quot;http:\/\/data-vocabulary.org\/Breadcrumb&quot;&gt;&lt;span itemprop=&quot;title&quot;&gt;&#8217;. wp_title(&#8221;, true) .'&lt;\/span&gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t}<br \/>\n\t\t$str.='&lt;\/ul&gt;&#8217;;<br \/>\n\t\t$str.='&lt;\/div&gt;&#8217;;<br \/>\n\t}<br \/>\n\techo $str;<br \/>\n}<br \/>\n?&gt;<br \/>\n[\/php]<br \/>\n<i class=\"icon-book\"><\/i> <small>\u30b3\u30fc\u30c9\u53c2\u8003\u5143 : http:\/\/webdesignrecipes.com\/wordpress-breadcrumb-list-tips\/<\/small><br \/>\n<br \/>\n<i class=\"icon-book\"><\/i> <small>\u30b3\u30fc\u30c9\u53c2\u8003\u5143 : https:\/\/gist.github.com\/wate\/50a4186223f187128549<\/small><\/p>\n<h4>2014\/08\/12\u8ffd\u8a18<\/h4>\n<p>\u4e0a\u8a18\u306e\u30b3\u30fc\u30c9\u3060\u3068\u30d1\u30fc\u30de\u30ea\u30f3\u30af\u306e\u8a2d\u5b9a\u3092\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u904b\u7528\u3057\u3066\u3044\u308b\u3068<br \/>\n<strong>\u30db\u30fc\u30e0\uff1e0\u5e74<\/strong><br \/>\n\u306e\u3088\u3046\u306b\u8868\u793a\u3055\u308c\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n<p>0\u5e74\u3068\u8868\u793a\u3055\u308c\u308b\u554f\u984c\u3092\u4fee\u6b63\u3057\u305f\u30d0\u30fc\u30b8\u30e7\u30f3\u306f\u4ee5\u4e0b\u3067\u3059\u3002<br \/>\n<a href=\"\/ithub.com\/apr20\/a43b6203a61940d77ac7\" title=\"wordpress \u30d1\u30f3\u304f\u305a\" target=\"_blank\">\u4fee\u6b63\u7248\uff08Gist\uff09<\/a><\/p>\n<p>[php]&lt;?php<\/p>\n<p>\/\/\u30d1\u30f3\u304f\u305a<br \/>\nfunction breadcrumb($divOption = array(&quot;id&quot; =&gt; &quot;bread&quot;, &quot;class&quot; =&gt; &quot;clear&quot;)){<br \/>\n\tglobal $post;<br \/>\n\t$str =&#8221;;<br \/>\n\tif(!is_home()&amp;&amp;!is_admin()){ \/* !is_admin \u306f\u7ba1\u7406\u30da\u30fc\u30b8\u4ee5\u5916\u3068\u3044\u3046\u6761\u4ef6\u5206\u5c90 *\/<br \/>\n\t\t$tagAttribute = &#8221;;<br \/>\n\t\tforeach($divOption as $attrName =&gt; $attrValue){<br \/>\n\t\t\t$tagAttribute .= sprintf(&#8216; %s=&quot;%s&quot;&#8217;, $attrName, $attrValue);<br \/>\n\t\t}<br \/>\n\t\t$str.= &#8216;&lt;div&#8217;. $tagAttribute .&#8217;&gt;&#8217;;<br \/>\n\t\t$str.= &#8216;&lt;ul&gt;&#8217;;<br \/>\n\t\t$str.= &#8216;&lt;li itemscope itemtype=&quot;http:\/\/data-vocabulary.org\/Breadcrumb&quot;&gt;&lt;a href=&quot;&#8217;. home_url() .&#8217;\/&quot; itemprop=&quot;url&quot;&gt;&lt;span itemprop=&quot;title&quot;&gt;\u30db\u30fc\u30e0&lt;\/span&gt;&lt;\/a&gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t$str.= &#8216;&lt;li&gt;&amp;gt;&lt;\/li&gt;&#8217;;<\/p>\n<p>\t\tif(is_category()) {\t\t\t\t\t\t\t\t\/\/\u30ab\u30c6\u30b4\u30ea\u30fc\u306e\u30a2\u30fc\u30ab\u30a4\u30d6\u30da\u30fc\u30b8<br \/>\n\t\t\t$cat = get_queried_object();<br \/>\n\t\t\tif($cat -&gt; parent != 0){<br \/>\n\t\t\t\t$ancestors = array_reverse(get_ancestors( $cat -&gt; cat_ID, &#8216;category&#8217; ));<br \/>\n\t\t\t\tforeach($ancestors as $ancestor){<br \/>\n\t\t\t\t\t$str.='&lt;li itemscope itemtype=&quot;http:\/\/data-vocabulary.org\/Breadcrumb&quot;&gt;&lt;a href=&quot;&#8217;. get_category_link($ancestor) .&#8217;&quot; itemprop=&quot;url&quot;&gt;&lt;span itemprop=&quot;title&quot;&gt;&#8217;. get_cat_name($ancestor) .'&lt;\/span&gt;&lt;\/a&gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t\t\t\t$str.='&lt;li&gt;&amp;gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t\t\t}<br \/>\n\t\t\t}<br \/>\n\t\t\t$str.='&lt;li itemscope itemtype=&quot;http:\/\/data-vocabulary.org\/Breadcrumb&quot;&gt;&lt;a href=&quot;&#8217;. get_category_link($cat -&gt; cat_ID) .&#8217;&quot; itemprop=&quot;url&quot;&gt;&lt;span itemprop=&quot;title&quot;&gt;&#8217;. $cat -&gt; name . &#8216;&lt;\/span&gt;&lt;\/a&gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t} elseif(is_single()){\t\t\t\t\t\t\t\/\/\u30d6\u30ed\u30b0\u306e\u500b\u5225\u8a18\u4e8b\u30da\u30fc\u30b8<br \/>\n\t\t\t$categories = get_the_category($post-&gt;ID);<br \/>\n\t\t\t$cat = $categories[0];<br \/>\n\t\t\tif($cat -&gt; parent != 0){<br \/>\n\t\t\t\t$ancestors = array_reverse(get_ancestors( $cat -&gt; cat_ID, &#8216;category&#8217; ));<br \/>\n\t\t\t\tforeach($ancestors as $ancestor){<br \/>\n\t\t\t\t\t$str.='&lt;li itemscope itemtype=&quot;http:\/\/data-vocabulary.org\/Breadcrumb&quot;&gt;&lt;a href=&quot;&#8217;. get_category_link($ancestor).&#8217;&quot; itemprop=&quot;url&quot;&gt;&lt;span itemprop=&quot;title&quot;&gt;&#8217;. get_cat_name($ancestor). &#8216;&lt;\/span&gt;&lt;\/a&gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t\t\t\t$str.='&lt;li&gt;&amp;gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t\t\t}<br \/>\n\t\t\t}<br \/>\n\t\t\t$str.='&lt;li itemscope itemtype=&quot;http:\/\/data-vocabulary.org\/Breadcrumb&quot;&gt;&lt;a href=&quot;&#8217;. get_category_link($cat -&gt; term_id). &#8216;&quot; itemprop=&quot;url&quot;&gt;&lt;span itemprop=&quot;title&quot;&gt;&#8217;. $cat-&gt; cat_name . &#8216;&lt;\/span&gt;&lt;\/a&gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t\t$str.='&lt;li&gt;&amp;gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t\t$str.= &#8216;&lt;li itemscope itemtype=&quot;http:\/\/data-vocabulary.org\/Breadcrumb&quot;&gt;&lt;a href=&quot;&#8217;.get_permalink($post-&gt;ID).&#8217;&quot; itemprop=&quot;url&quot;&gt;&lt;span itemprop=&quot;title&quot;&gt;&#8217;. $post -&gt; post_title .'&lt;\/span&gt;&lt;\/a&gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t} elseif(is_page()){\t\t\t\t\t\t\t\/\/\u56fa\u5b9a\u30da\u30fc\u30b8<br \/>\n\t\t\tif($post -&gt; post_parent != 0 ){<br \/>\n\t\t\t\t$ancestors = array_reverse(get_post_ancestors( $post-&gt;ID ));<br \/>\n\t\t\t\tforeach($ancestors as $ancestor){<br \/>\n\t\t\t\t\t$str.='&lt;li itemscope itemtype=&quot;http:\/\/data-vocabulary.org\/Breadcrumb&quot;&gt;&lt;a href=&quot;&#8217;. get_permalink($ancestor).&#8217;&quot; itemprop=&quot;url&quot;&gt;&lt;span itemprop=&quot;title&quot;&gt;&#8217;. get_the_title($ancestor) .'&lt;\/span&gt;&lt;\/a&gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t\t\t\t$str.='&lt;li&gt;&amp;gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t\t\t}<br \/>\n\t\t\t}<br \/>\n\t\t\t$str.= &#8216;&lt;li itemscope itemtype=&quot;http:\/\/data-vocabulary.org\/Breadcrumb&quot;&gt;&lt;a href=&quot;&#8217;.get_permalink($post-&gt;ID).&#8217;&quot; itemprop=&quot;url&quot;&gt;&lt;span itemprop=&quot;title&quot;&gt;&#8217;. $post -&gt; post_title .'&lt;\/span&gt;&lt;\/a&gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t} elseif(is_date()){\t\t\t\t\t\t\t\/\/\u65e5\u4ed8\u30d9\u30fc\u30b9\u306e\u30a2\u30fc\u30ab\u30a4\u30d6\u30da\u30fc\u30b8<br \/>\n\t\t\tif(is_day()){\t\t\t\t\/\/\u65e5\u5225\u30a2\u30fc\u30ab\u30a4\u30d6<br \/>\n\t\t\t\t$str.='&lt;li itemscope itemtype=&quot;http:\/\/data-vocabulary.org\/Breadcrumb&quot;&gt;&lt;a href=&quot;&#8217;. get_year_link(get_the_time(&#8216;Y&#8217;)). &#8216;&quot; itemprop=&quot;url&quot;&gt;&lt;span itemprop=&quot;title&quot;&gt;&#8217; . get_the_time(&#8216;Y&#8217;). &#8216;\u5e74&lt;\/span&gt;&lt;\/a&gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t\t\t$str.='&lt;li&gt;&amp;gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t\t\t$str.='&lt;li itemscope itemtype=&quot;http:\/\/data-vocabulary.org\/Breadcrumb&quot;&gt;&lt;a href=&quot;&#8217;. get_month_link(get_the_time(&#8216;Y&#8217;), get_the_time(&#8216;m&#8217;)). &#8216;&quot; itemprop=&quot;url&quot;&gt;&lt;span itemprop=&quot;title&quot;&gt;&#8217;. get_the_time(&#8216;m&#8217;) .&#8217;\u6708&lt;\/span&gt;&lt;\/a&gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t\t\t$str.='&lt;li&gt;&amp;gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t\t\t$str.='&lt;li itemscope itemtype=&quot;http:\/\/data-vocabulary.org\/Breadcrumb&quot;&gt;&lt;a href=&quot;&#8217;. get_day_link(get_the_time(&#8216;Y&#8217;), get_the_time(&#8216;m&#8217;), get_the_time(&#8216;d&#8217;)) .&#8217;&quot; itemprop=&quot;url&quot;&gt;&lt;span itemprop=&quot;title&quot;&gt;&#8217;. get_the_time(&#8216;d&#8217;). &#8216;\u65e5&lt;\/span&gt;&lt;\/a&gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t\t} elseif(is_month()){\t\/\/\u6708\u5225\u30a2\u30fc\u30ab\u30a4\u30d6<br \/>\n\t\t\t\t$str.='&lt;li itemscope itemtype=&quot;http:\/\/data-vocabulary.org\/Breadcrumb&quot;&gt;&lt;a href=&quot;&#8217;. get_year_link(get_the_time(&#8216;Y&#8217;)) .&#8217;&quot; itemprop=&quot;url&quot;&gt;&lt;span itemprop=&quot;title&quot;&gt;&#8217;. get_the_time(&#8216;Y&#8217;) .&#8217;\u5e74&lt;\/span&gt;&lt;\/a&gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t\t\t$str.='&lt;li&gt;&amp;gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t\t\t$str.='&lt;li itemscope itemtype=&quot;http:\/\/data-vocabulary.org\/Breadcrumb&quot;&gt;&lt;a href=&quot;&#8217;. get_month_link(get_the_time(&#8216;Y&#8217;), get_the_time(&#8216;m&#8217;)) .&#8217;&quot; itemprop=&quot;url&quot;&gt;&lt;span itemprop=&quot;title&quot;&gt;&#8217;. get_the_time(&#8216;m&#8217;). &#8216;\u6708&lt;\/span&gt;&lt;\/a&gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t\t} else {\t\t\t\t\t\t\t\t\t\/\/\u5e74\u5225\u30a2\u30fc\u30ab\u30a4\u30d6<br \/>\n\t\t\t\t$str.='&lt;li itemscope itemtype=&quot;http:\/\/data-vocabulary.org\/Breadcrumb&quot;&gt;&lt;a href=&quot;&#8217;. get_year_link(get_the_time(&#8216;Y&#8217;)) .&#8217;&quot; itemprop=&quot;url&quot;&gt;&lt;span itemprop=&quot;title&quot;&gt;&#8217;. get_the_time(&#8216;Y&#8217;) .&#8217;\u5e74&lt;\/span&gt;&lt;\/a&gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t\t}<br \/>\n\t\t} elseif(is_search()) {\t\t\t\t\t\t\t\/\/\u691c\u7d22\u7d50\u679c\u8868\u793a\u30da\u30fc\u30b8<br \/>\n\t\t\t$str.='&lt;li itemscope itemtype=&quot;http:\/\/data-vocabulary.org\/Breadcrumb&quot;&gt;&lt;a href=&quot;&#8217;.get_bloginfo(&#8216;url&#8217;).&#8217;\/?&#8217;.$_SERVER[&#8216;QUERY_STRING&#8217;].&#8217;&quot; itemprop=&quot;url&quot;&gt;&lt;span itemprop=&quot;title&quot;&gt;\u300c&#8217;. get_search_query() .&#8217;\u300d\u306e\u691c\u7d22\u7d50\u679c&lt;\/span&gt;&lt;\/a&gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t} elseif(is_author()){\t\t\t\t\t\t\t\/\/\u6295\u7a3f\u8005\u306e\u30a2\u30fc\u30ab\u30a4\u30d6\u30da\u30fc\u30b8<br \/>\n\t\t\t$str .='&lt;li itemscope itemtype=&quot;http:\/\/data-vocabulary.org\/Breadcrumb&quot;&gt;&lt;a href=&quot;&#8217;.get_author_posts_url(get_query_var(&#8216;author&#8217;)).&#8217;&quot; itemprop=&quot;url&quot;&gt;&lt;span itemprop=&quot;title&quot;&gt;\u6295\u7a3f\u8005 : &#8216;. get_the_author_meta(&#8216;display_name&#8217;, get_query_var(&#8216;author&#8217;)).'&lt;\/span&gt;&lt;\/a&gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t} elseif(is_tag()){\t\t\t\t\t\t\t\t\/\/\u30bf\u30b0\u306e\u30a2\u30fc\u30ab\u30a4\u30d6\u30da\u30fc\u30b8<br \/>\n\t\t\t$str.='&lt;li itemscope itemtype=&quot;http:\/\/data-vocabulary.org\/Breadcrumb&quot;&gt;&lt;a href=&quot;&#8217;.get_tag_link(get_query_var(&#8216;tag_id&#8217;)).&#8217;&quot; itemprop=&quot;url&quot;&gt;&lt;span itemprop=&quot;title&quot;&gt;\u30bf\u30b0 : &#8216;. single_tag_title( &#8221; , false ). &#8216;&lt;\/span&gt;&lt;\/a&gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t} elseif(is_attachment()){\t\t\t\t\t\t\/\/\u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\u30da\u30fc\u30b8<br \/>\n\t\t\t$str.= &#8216;&lt;li itemscope itemtype=&quot;http:\/\/data-vocabulary.org\/Breadcrumb&quot;&gt;&lt;span itemprop=&quot;title&quot;&gt;&#8217;. $post -&gt; post_title .'&lt;\/span&gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t} elseif(is_404()){\t\t\t\t\t\t\t\t\/\/404 Not Found \u30da\u30fc\u30b8<br \/>\n\t\t\t$str.='&lt;li itemscope itemtype=&quot;http:\/\/data-vocabulary.org\/Breadcrumb&quot;&gt;&lt;span itemprop=&quot;title&quot;&gt;404 Not found&lt;\/span&gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t} else{\t\t\t\t\t\t\t\t\t\t\t\/\/\u305d\u306e\u4ed6<br \/>\n\t\t\t$str.='&lt;li itemscope itemtype=&quot;http:\/\/data-vocabulary.org\/Breadcrumb&quot;&gt;&lt;span itemprop=&quot;title&quot;&gt;&#8217;. wp_title(&#8221;, true) .'&lt;\/span&gt;&lt;\/li&gt;&#8217;;<br \/>\n\t\t}<br \/>\n\t\t$str.='&lt;\/ul&gt;&#8217;;<br \/>\n\t\t$str.='&lt;\/div&gt;&#8217;;<br \/>\n\t}<br \/>\n\techo $str;<br \/>\n}<\/p>\n<p>?&gt;[\/php]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>WordPress\u306e\u30d1\u30f3\u304f\u305a\u30ea\u30b9\u30c8\u3092\u30ea\u30c3\u30c1\u30b9\u30cb\u30da\u30c3\u30c8(microdata)\u306b\u5bfe\u5fdc&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14,18,2,5],"tags":[],"class_list":["post-2807","post","type-post","status-publish","format-standard","hentry","category-php","category-seo","category-web","category-wordpress-web-category"],"_links":{"self":[{"href":"https:\/\/apr20.net\/index.php?rest_route=\/wp\/v2\/posts\/2807","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/apr20.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/apr20.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/apr20.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/apr20.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2807"}],"version-history":[{"count":0,"href":"https:\/\/apr20.net\/index.php?rest_route=\/wp\/v2\/posts\/2807\/revisions"}],"wp:attachment":[{"href":"https:\/\/apr20.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2807"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/apr20.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2807"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/apr20.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2807"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}