On site I have left menu, which appears on almost every subpage
<div class="category_menu">
<nav class="cat_menu">
<div class="menu_title parent_cat_name">
<h6><?php echo $category->name; ?></h6>
</div>
<?php rs_left_menu_subcats($subcategories); ?>
</nav>
</div>
I would like do display the another menu if site is homepage. In other cases it should be menu from code I pasted.
What code may I use?
You can combine
is_front_page()
andis_home()
WordPress function.If you want to display specific content on wordpress homepage than you can do it using
is_front_page()
Since
is_front_page()
andis_home()
for me doesn’t work (WP 5.2.3), I write this condition:Variant with php — answer by @hardik solanki
Variant with CSS: