php - Create an href that has the same post type
I have a custom post type named "episodes". I also have created a template for this custom post type called "single-episodes" when I get the template from "inc/episodios.php" it looks like this ...
get_header();
// Get template part
get_template_part('inc/episodios');
get_footer();
After that duplicate "episidios.php" and rename "episodios-see.php" with some modifications, both templates have the same custom post type called "episodes". I want create a link from episidios.php to episodios-see.php. For example:
<a href="link to episodios-see.php" class="myButton"> watch episodes </a>
How can I do this?
Answer
Solution:
Try <a href="<?php echo get_permalink(); ?>" class="myButton"> watch episodes </a>
This will link to each single-episode from inside the loop
Source