<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Snipplr</title>
    <description>Recent snippets posted on Snipplr.com</description>
    <link>https://snipplr.com/</link>
    <lastBuildDate>Wed, 17 Jun 2026 10:13:06 +0000</lastBuildDate>
    <item>
      <title>(PHP) WordPress WP Nav Menu Custom HTML ID Based on Page or Category Titles - SFLWebDev</title>
      <link>https://snipplr.com/view/66686/wordpress-wp-nav-menu-custom-html-id-based-on-page-or-category-titles</link>
      <description>&lt;p&gt;This function, when placed in a theme's 'functions.php' file will insert a custom id attribute into the '&lt;li&gt;' elements generated by a 'wp_nav_menu' function based on the title of the element. It will make a WordPress page or category into a hyphen separated string for CSS styling.&#13;
&#13;
For example, if a post category has the name "This &amp; That", it will generate an HTML id attribute as "this-that".&#13;
&#13;
This version replaces spaces and ampersands - other characters can be added to the "str_replace" functions to filter out other characters that may exist in the "$item_details&gt;title" property.&lt;/p&gt;</description>
      <pubDate>Sun, 12 Aug 2012 10:36:57 UTC</pubDate>
      <guid>https://snipplr.com/view/66686/wordpress-wp-nav-menu-custom-html-id-based-on-page-or-category-titles</guid>
    </item>
  </channel>
</rss>
