admin管理员组

文章数量:1305513

I am trying to open the thumbnail image on a new page using WordPress. For example. I have all the detail of a single post on a page and if someone clicks on the link given on a single page it opens the thumbnail on another page as a child theme.

Single Page Code "single.php"

<a href="WHAT SHOULD I DO HERE" ); ?>">link to Another Page </a>

Theme of Another Page with name single-thumnail.php

<?php 
/***
Template Name: Advertisement
***/

get_header(); ?>

<?php echo get_the_post_thumbnail_url(); ?>

<?php get_sidebar(); ?>
<?php get_footer(); ?>

I am trying to open the thumbnail image on a new page using WordPress. For example. I have all the detail of a single post on a page and if someone clicks on the link given on a single page it opens the thumbnail on another page as a child theme.

Single Page Code "single.php"

<a href="WHAT SHOULD I DO HERE" ); ?>">link to Another Page </a>

Theme of Another Page with name single-thumnail.php

<?php 
/***
Template Name: Advertisement
***/

get_header(); ?>

<?php echo get_the_post_thumbnail_url(); ?>

<?php get_sidebar(); ?>
<?php get_footer(); ?>
Share Improve this question edited Jan 25, 2021 at 14:14 fuxia 107k38 gold badges255 silver badges459 bronze badges asked Jan 25, 2021 at 13:55 Pak WorkForcePak WorkForce 314 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

You can pass post slug in the query string with your new page URL.

single-thumnail.php?post=slug

Fetched thumb image by post id and show.

本文标签: Open Image Thumbnail in a new pagewhile clicking on the link