New to code igniter and would appreciate any advice.
I am trying to make the link in my header go to the pub_category_name instead of a list of the stores in the category.
Each category will only have one store/location to go to which is assigned in admin. So there will never be a need to display more than one for each category.
Here is the code from the header
<li class="gnb"><a class="mn-stores" href="stores">Publications</a>
<div class="menu-contain-gift">
<ul>
<?php
foreach ($mainPublications->result() as $row){
if ($row->pub_name != ''){
?>
<li><a href="stores/?pubid=<?php echo $row->id; ?>"><?php echo $row->pub_name;?></a>
<?php if (in_array($row->id, $pub_root_id_arr)){?>
<div class="submenu-contain">
<ul>
<?php
foreach ($all_publication->result() as $row1){
if ($row1->pub_name != '' && $row->id==$row1->rootID){ ?>
<li style="position: relative;"><a href="stores/?pubid=<?php echo $row1->id; ?>"><?php echo $row1->pub_name;?></a>
<?php }
} ?>
</ul>
</div>
<?php } ?>
</li>
<?php }
} ?>
</ul>