0

I got a sitemap in my footer that links to all my pages, some pages have different urls because of a rewrite. For example, pages with id 14 have /projects/ before them, and pages with id 16 have /actueel/. How can I check on that and build the list?

This doesn't work (it adds projects to the entire list):

<?
foreach($menufootercr as $menufooterlist){
  if($menufooterlist['id'] != ''){
      if($menufooterlist['id'] = '14'){
        $menufooteroverzicht .= '<li class="menu-item"><a href="projects/'.$menufooterlist['alias'].'.html">'.$menufooterlist['title'].'</a></li>';
      }else if($menufooterlist['id'] = '16'){
        $menufooteroverzicht .= '<li class="menu-item"><a href="actueel/'.$menufooterlist['alias'].'.html">'.$menufooterlist['title'].'</a></li>';
      }else{
      $menufooteroverzicht .= '<li class="menu-item"><a href="info/'.$menufooterlist['alias'].'.html">'.$menufooterlist['title'].'</a></li>';
    }
  }
}
echo $menufooteroverzicht;
?>
twan
  • 2,450
  • 10
  • 32
  • 92

1 Answers1

1

Change

if($menufooterlist['id'] = '14'){

to

if($menufooterlist['id'] == '14'){

Do the same for 16. == is used for comparison not =

Prem Raj
  • 849
  • 4
  • 15