You are here:  » Show on all pages but not index.php


Show on all pages but not index.php

Submitted by wesse249 on Thu, 2016-06-02 18:22 in

Hello David,

I try to add a menu in my sidebox. I want to show the menu on every page but not on my index.

Ik have this code. These code shows only the menu on the index. How can i change this that it is not showed on the index and still showed on my other pages?

<?php if (strpos($_SERVER["PHP_SELF"],"index.php")!==FALSE): ?>
<div class='row'>
<div class='medium-2 columns show-for-medium-up'>
  <!-- sidebar content here -->
  <!-- sidebar content endhere -->
</div>
<div class='small-12 medium-10 columns'>
<?php endif; ?>

Thank you,

Jan Roel

Submitted by support on Fri, 2016-06-03 08:23

Hello Jan,

=== is the boolean opposite of !== so have a go with;

<?php if (strpos($_SERVER["PHP_SELF"],"index.php")===FALSE): ?>
<div class='row'>
<div class='medium-2 columns show-for-medium-up'>
  <!-- sidebar content here -->
  <!-- sidebar content endhere -->
</div>
<div class='small-12 medium-10 columns'>
<?php endif; ?>

Cheers,
David.
--
PriceTapestry.com