Strange behaviour | WordPress.org

[ad_1]

Hello everyone,
I have problems with the code below:
When I use this code in an local environement, these code works fine when ‘unsere leistungen’ is capalized ‘Unsere Leistungen’ . ‘Unsere Leistungen’ is the title of a page.
The titles of the other pages have the first letter capitalized too in their titles, but it doesn’t seem to bother, since the navigation works fine. This is a mystery to me. When I’m publishing this code on a debian Server with apache2, the version with teh capitalized letters (Unsere Leistungen) doesn’t work at all and the nav entry doesn’t show up. Only when I use ‘unsere leistungen’ the entry is shown, but it doesn’t change the picture (from dark-grey to a light-grey) when I’m nagivating to this page.
Anyone an idea, what’s the issue here?


<code></code><!-- PHP TEST NAV MENU -->  
 <?php 
    $sites=array('home','unsere leistungen','projekte','impressum','kontakt');
    $i=1;

    foreach($sites as $siteName)
            { 
              if($siteName == is_page($siteName) or ($i==1 AND is_home())) 
            { 
                    ?>
                <div class="nav">
                  <img border="0" src="<?php echo get_theme_file_uri('images/'.$siteName.'_c.png'); ?>" 
                  alt="<?php echo $SiteName; ?>" title="<?php echo $SiteName; ?>" name="<?php echo 'menuimg'.$siteName; ?>">
            
                </div>
           

           <?php 

                        }              
            else 
            {                       
           ?>
                     <div class="nav">
                        <a onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('<?php echo 'menuimg'.$i; ?>','',
                            '<?php echo get_theme_file_uri('images/'.$siteName.'_a.png') ?>',1)"
                            href="<?php 
                                if($i==1)
                                   {
                                    echo site_url();
                                   }
                                else
                                {
                                  echo site_url($siteName);
                                } ?> "><img border="0" 
                            src="<?php echo get_theme_file_uri('images/'.$siteName.'_.png'); ?>" 
                            alt="<?php echo $SiteName; ?>" title="<?php echo $SiteName; ?>" 
                            name="<?php echo 'menuimg'.$i; ?>"
                            
                            
                            >
                        </a>
                        
                        <script type="text/javascript">
                            MM_preloadImages('<?php echo get_theme_file_uri('images/'.$siteName.'_a.png'); ?>')
                        </script>
                    </div>

            <?php 
             
        }
        $i++; } 
        reset($sites);
        $i=1;
        ?>

is a mystery for

<!-- PHP TEST NAV MENU -->  
 <?php 
    $sites=array('home','unsere leistungen','projekte','impressum','kontakt');
    $i=1;

    foreach($sites as $siteName)
            { 
              if($siteName == is_page($siteName) or ($i==1 AND is_home())) 
            { 
                    ?>
                <div class="nav">
                  <img border="0" src="<?php echo get_theme_file_uri('images/'.$siteName.'_c.png'); ?>" 
                  alt="<?php echo $SiteName; ?>" title="<?php echo $SiteName; ?>" name="<?php echo 'menuimg'.$siteName; ?>">
            
                </div>
           

           <?php 

                        }              
            else 
            {                       
           ?>
                     <div class="nav">
                        <a onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('<?php echo 'menuimg'.$i; ?>','',
                            '<?php echo get_theme_file_uri('images/'.$siteName.'_a.png') ?>',1)"
                            href="<?php 
                                if($i==1)
                                   {
                                    echo site_url();
                                   }
                                else
                                {
                                  echo site_url($siteName);
                                } ?> "><img border="0" 
                            src="<?php echo get_theme_file_uri('images/'.$siteName.'_.png'); ?>" 
                            alt="<?php echo $SiteName; ?>" title="<?php echo $SiteName; ?>" 
                            name="<?php echo 'menuimg'.$i; ?>"
                            
                            
                            >
                        </a>
                        
                        <script type="text/javascript">
                            MM_preloadImages('<?php echo get_theme_file_uri('images/'.$siteName.'_a.png'); ?>')
                        </script>
                    </div>

            <?php 
             
        }
        $i++; } 
        reset($sites);
        $i=1;
        ?>
  • This topic was modified 4 hours, 39 minutes ago by Jan Dembowski.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer