-2

I have a bunch of different menu pages (using custom fields) for a local restaurant and want to show a PDF menu only one one of these pages. I am trying to add a line of code to the template for the Menu pages that only shows up on the page with the slug 'wine-list'.

Here is what I did but it does not work:

<?php if(is_single( 'wine-list' )){
    echo '<a href="LINK-TO-PDF.pdf" target="_blank">View our full wine list</a>'; 
}
else{} ?>
j08691
  • 204,283
  • 31
  • 260
  • 272
mdnash
  • 81
  • 9

1 Answers1

6

use the if is_page

<?php if(is_page( 'wine-list' )){
    echo '<a href="LINK-TO-PDF.pdf" target="_blank">View our full wine list</a>'; 
}
else{} ?>
Moishy
  • 3,560
  • 3
  • 23
  • 42