Edit the file header.php of your theme to add such a menu.
Click to Read More
On Synology, this file is accessible via the “web” shared folder (See here for details) at:
\\<YourSynology>\web\wordpress\wp-content\themes\<YourTheme>\header.php
Find the right location in the code generating the navigation bar and add something like this (using the adequate ‘class’ from you own theme. Here after, I am using TwentyEleven.)
[html]<!– Add a drop dow menu with all the categories –>
<div style="text-align:center;">
<ul id="menu" style="padding:0; margin:0;">
<li class="cat-item">
<a href="#" title="Filter by categories.">Categories</a>
<ul class="children">
<?php wp_list_categories(‘sort_column=name&sort_order=asc&
style=list&children=true&hierarchical=true&
title_li=0&exclude=1’); ?>
</ul>
</li>
</ul>
</div>
Instead of href=”#” (to stay on the current page when selecting the head of that menu), you could also use:
[php]href="<?php echo esc_url( home_url( ‘/’ ) ); ?>"[/php]The parameter “exclude=1” is used to skip the category “Uncategorized”. You can add other category IDs to be skipped separated with a comma. To determine the ID of a category, go to “Administration Dashboard > Posts > Categories” and move the mouse over the “Edit” link for that category. Look at the URL displayed by the browser for that link; this one includes the category ID as a parameter: “&tag_ID=xxx”
Leave a Reply