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

<channel>
	<title>WordPress &#8211; 「马马虎虎」</title>
	<atom:link href="https://www.gek6.cn/category/web-service/wordpres/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.gek6.cn</link>
	<description>极客蜗牛-开发效率很慢的...</description>
	<lastBuildDate>Sun, 05 Dec 2021 11:57:36 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.6.2</generator>

<image>
	<url>https://www.gek6.cn/wp-content/uploads/2021/12/20211205200322145-32x32.png</url>
	<title>WordPress &#8211; 「马马虎虎」</title>
	<link>https://www.gek6.cn</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>「WordPress」自定义菜单</title>
		<link>https://www.gek6.cn/%e3%80%8cwordpress%e3%80%8d%e8%87%aa%e5%ae%9a%e4%b9%89%e8%8f%9c%e5%8d%95/</link>
					<comments>https://www.gek6.cn/%e3%80%8cwordpress%e3%80%8d%e8%87%aa%e5%ae%9a%e4%b9%89%e8%8f%9c%e5%8d%95/#respond</comments>
		
		<dc:creator><![CDATA[lane]]></dc:creator>
		<pubDate>Sun, 05 Dec 2021 11:57:36 +0000</pubDate>
				<category><![CDATA[WordPress]]></category>
		<guid isPermaLink="false">https://www.gek6.cn/?p=63</guid>

					<description><![CDATA[注册菜单 后面不单独说明的话，根&#46;&#46;&#46;]]></description>
										<content:encoded><![CDATA[<h3>注册菜单</h3>
<blockquote>
<p>后面不单独说明的话，根目录都是从主题目录出发</p>
</blockquote>
<p><code>/functions.php</code></p>
<pre><code class="language-php">&lt;?php
// 自定义 菜单注册函数
function register_my_menus() {
  register_nav_menus(
    array(
      // key 为后台管理-菜单管理中-关联操作时看到的
      // __(value) 这个为后台管理-自定义菜单-的菜单名称-或自己起个名字
      &#039;top_menu&#039; =&gt; __( &#039;top_menu&#039; ),
      // 可配置多个菜单 如 顶部的 底部的
      &#039;xxxx-menu&#039; =&gt; __( &#039;xxxxx&#039; )
     )
   );
 }
 add_action( &#039;init&#039;, &#039;register_my_menus&#039; );</code></pre>
<h3>关联菜单</h3>
<p><img decoding="async" src="https://thamiti-blog.oss-accelerate.aliyuncs.com/tuchuang/WordPress/image.png" alt="image" /></p>
<h3>调用菜单</h3>
<pre><code>&lt;div class=&quot;main-menu&quot;&gt;
    &lt;nav id=&quot;mobile-menu&quot;&gt;
            &lt;?php wp_nav_menu(array(
                &#039;container&#039; =&gt; &#039;&#039;,
                &#039;menu_class&#039; =&gt; &#039;&#039;,
                &#039;menu&#039; =&gt; &#039;primary&#039;,
                &#039;theme_location&#039; =&gt; &#039;top_menu&#039;,
                &#039;link_before&#039; =&gt; &#039;&lt;span&gt;&#039;,
                &#039;link_after&#039; =&gt; &#039;&lt;/span&gt;&#039;,
            )); ?&gt;
    &lt;/nav&gt;
&lt;/div&gt;</code></pre>
]]></content:encoded>
					
					<wfw:commentRss>https://www.gek6.cn/%e3%80%8cwordpress%e3%80%8d%e8%87%aa%e5%ae%9a%e4%b9%89%e8%8f%9c%e5%8d%95/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
