0

I want to put a link in the single.php page of wordpress that can take me to another page for example book.php as I do. I have this

<a href="book.php">book</a> it does not work 

<a href="<?php the_permalink();?>"><?php the_title();?></a>

Stymark
  • 55
  • 5

2 Answers2

0

Try this

<a href="<?php the_permalink();?>" target="_blank"><?php the_title();?></a>

<a href="book.php" target="_blank">book</a>

What is target: The target attribute specifies where to open the linked document:

  • _blank: Opens the linked document in a new window or tab

Refer here for more info regarding target: https://www.w3schools.com/tags/att_a_target.asp

Hope this helps.

Always Helping
  • 14,316
  • 4
  • 13
  • 29
0

I get page not found not if it is possible for example from index.php it goes to single.php but from single to another page I don't know how to do it I always get not found

Stymark
  • 55
  • 5
  • Make sure you are URL endpoint is correct. Page not found only when you are book.php and but book.php is in pages/book.php. Hope this helps. – Always Helping Jun 12 '20 at 00:25