• I’ve searched the forums, and the documentation, but I cannot find how to do the following:

    The left sidebar on my site (www.ff-magazin.com) is supposed to have a link back to the main page, unless of course the page already is the main page (index.php).

    Right now I have this code display a simple hyperlink to the index.php, like so:

    <li class="widget">
    				<h2>FF Hauptseite</h2>
    				<ul>
    				<a href="https://ffmagazin.com/" title="Zurück zur Hauptseite">Zurück zur Hauptseite</a></li>
    				</ul>
    			</li>

    What do I need to ad to keep this from displaying on the index.php?

    Any help, pointers would be appreciated as this can’t be that hard, but I couldn’t find any info on this.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You may want to read about the Conditional_Tags

    Hey subimeyere here is what I would do, something like this:

    <?php if (is_home()) { ?>
    
    <!-- home - dont' show hyperlink to index.php -->
    
    <?php } else { ?>
    
    <li class="widget">
    <h2>FF Hauptseite</h2>
    <ul>
    <li><a href="https://ffmagazin.com/" title="Zurück zur Hauptseite">Zurück zur Hauptseite</a></li>
    </ul>
    </li>
    
    <?php } ?>

    By using conditional tags we can set rules for when people are at different places. So if they are on the home page they wont see your link … if they are on any other page (else) they will.

    Hope this helps.

    Thread Starter sebimeyer

    (@sebimeyer)

    many thanks alanwho, that’s precisely what I’ve ben trying to do for days now! Much appreciated!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘exclude hyperlinks from index.php’ is closed to new replies.