0

I know nothing about PHP. I have the code below to show next and prev at the bottom of each page, with <-|-> as a separator but I don't want it on the home/index page.

<div align="center" >
<?php echo previous_page_not_post(); ?> <-|->  <?php echo next_page_not_post(); ?>
</div>

How can I do this?

durron597
  • 31,968
  • 17
  • 99
  • 158

1 Answers1

1

You can add an if statement like this:

<div align="center">
<?php
    if (basename($_SERVER['PHP_SELF']) != "index.php") {
        echo previous_page_not_post()." <-|-> ".next_page_not_post();
    }
?>
</div>

(Look at get current php page name)

Community
  • 1
  • 1
Tommaso Bertoni
  • 2,333
  • 1
  • 22
  • 22