How to make a submenu per category
-
Hi,
I want to make some submenus, or some links to posts or categories to apear on some categories.Let me explain, is like in joomla. When i enter in a category I want to show a menu only in that category under the main menu, and i want to show a different menu for more of 30 categories, at this time i made an test that is working great :
At this time i have somehting like this “:
<?php if ( in_category('fotbal-romania-liga-1')) { echo "<div class='liga1'><a href='https://pariuri-x.ro/clasament-fotbal-romania-liga-1.html' title='Clasament fotbal - Romania Liga 1'>Clasament Liga 1</a> | <a href='https://pariuri-x.ro/program-si-rezultate-fotbal-romania-liga-1.html' title='Program si rezultate fotbal - Romania Liga 1'>Program si rezultate liga 1</a></div>"; } if ( in_category('fotbal-romania-liga-2')) { echo "<div class='liga1'> <a href='https://pariuri-x.ro/program-si-rezultate-fotbal-romania-liga-2-seria-1.html' title='Program si rezultate fotbal Romania Liga 2 Seria 1 '>Program si rezultate Liga 2 Seria 1</a> | <a href='https://pariuri-x.ro/clasament-fotbal-romania-liga-2-seria-1.html' title='Clasament fotbal Romania Liga 2 Seria 1 '>Clasament Liga 2 Seria 1</a></div> <div class='liga1'> <a href='https://pariuri-x.ro/program-si-rezultate-fotbal-romania-liga-2-seria-2.html' title='Program si rezultate fotbal Romania Liga 2 Seria 2 '>Program si rezultate Liga 2 Seria 2</a> | <a href='https://pariuri-x.ro/clasament-fotbal-romania-liga-2-seria-2.html' title='Clasament fotbal Romania Liga 2 Seria 2 '>Clasament Liga 2 Seria 2</a> </div>"; } ?>
This shows the submenu (submenu is acsualy some code with links) i want for each category i selected.
but i have mor ethen 30 categories, it is ok to have so many if ?
Or wich will be the fastest method ?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘How to make a submenu per category’ is closed to new replies.