Title: exclude hyperlinks from index.php
Last modified: August 19, 2016

---

# exclude hyperlinks from index.php

 *  [sebimeyer](https://wordpress.org/support/users/sebimeyer/)
 * (@sebimeyer)
 * [18 years, 1 month ago](https://wordpress.org/support/topic/exclude-hyperlinks-from-indexphp/)
 * 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="http://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)

 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [18 years, 1 month ago](https://wordpress.org/support/topic/exclude-hyperlinks-from-indexphp/#post-748500)
 * You may want to read about the [Conditional_Tags](http://codex.wordpress.org/Conditional_Tags)
 *  [alanwho](https://wordpress.org/support/users/alanwho/)
 * (@alanwho)
 * [18 years, 1 month ago](https://wordpress.org/support/topic/exclude-hyperlinks-from-indexphp/#post-748506)
 * 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="http://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](https://wordpress.org/support/users/sebimeyer/)
 * (@sebimeyer)
 * [18 years, 1 month ago](https://wordpress.org/support/topic/exclude-hyperlinks-from-indexphp/#post-748652)
 * 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.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 3 participants
 * Last reply from: [sebimeyer](https://wordpress.org/support/users/sebimeyer/)
 * Last activity: [18 years, 1 month ago](https://wordpress.org/support/topic/exclude-hyperlinks-from-indexphp/#post-748652)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
