So I take this code and make a component from it and call it it as a param in the get_nav function. Cool. Just dont know how to do the if/else
I've tried it but doesnt work.
Heck I'm such a PHP noob its embarassing!!
Here is what I'm trying to achieve. Some of the list items weather or not they are parent or child are not click-able.
I've tried it but doesnt work.
Code:
<li class="<?php echo $item->classes; ?>">
<?php if ($item->hasChildren) {
<a href="<?php echo htmlspecialchars($item->link); ?>">
<?php echo htmlspecialchars($item->text); ?>
</a>
} else {
<?php echo htmlspecialchars($item->text); ?>
} ?>
<?php if ($item->isOpen) { ?>
<ul><?php $item->outputChildren(); ?></ul>
<?php } ?>
</li>
Heck I'm such a PHP noob its embarassing!!
Here is what I'm trying to achieve. Some of the list items weather or not they are parent or child are not click-able.