Exclude Categories from Navigation

Post Reply
Yannis
Jr. Bludit
Posts: 3
Joined: Thu Nov 28, 2019 10:25 am

Please! How can I exclude categories from Navigation menu please?
I am using the Typerite1.1 theme and Categories plugin with Enabled "Hide Categories without content" but does not working.
"Categories" label, appearing in my Sidebar menu without any categories content!

Thanks!
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

1) Categories are part of the theme. You do not need the plugin.

2) Delete categories that are not used at "Manage" > "Categories".

3) Or modify the template index.php in the directory /bl-themes/typerite-1.1 (line 108):

Code: Select all

                    <!-- Categories -->
		        <li class="has-children">
                        <a href="#0" title="">Categories</a>
                        <ul class="sub-menu">
                        <?php
                        	foreach ($categories->db as $categoryKey=>$categoryFields):
					$count = count($categoryFields['list']);
					if ($count>0) {
			?>
                        <li><a href="<?php echo DOMAIN_CATEGORIES.$categoryKey ?>"><?php echo $categoryFields['name'] ?></a></li>
                        <?php } endforeach ?>
                        </ul>
			</li>
instead of

Code: Select all

                    <!-- Categories -->
		        <li class="has-children">
                        <a href="#0" title="">Categories</a>
                        <ul class="sub-menu">
                        <?php foreach ($categories->db as $categoryKey=>$categoryFields): ?>
                        <li><a href="<?php echo DOMAIN_CATEGORIES.$categoryKey ?>"><?php echo $categoryFields['name'] ?></a></li>
                        <?php endforeach ?>
                        </ul>
                    	</li>
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
Yannis
Jr. Bludit
Posts: 3
Joined: Thu Nov 28, 2019 10:25 am

Thanks Edi!
I have replace the code in index.php and I have zero categories in the manage section,
but Categories still be there in the menu of Typerite 1.1 !!!

Take a look please:

https://infotec.gr/spyrou/
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

Yannis wrote: Mon Oct 26, 2020 3:48 pm I have replace the code in index.php and I have zero categories in the manage section,
but Categories still be there in the menu of Typerite 1.1 !!!
This is the title of the section in the navigation sidebar.

If you do not use categories you can delete the code for categories from the template.
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
Post Reply