Php 将图像链接到post it';与…有关的
我正在使用“高级自定义字段”,并创建了一个存档页面,以显示来自“property_sales”自定义帖子类型的帖子 这是完整的模板Php 将图像链接到post it';与…有关的,php,html,wordpress-theming,Php,Html,Wordpress Theming,我正在使用“高级自定义字段”,并创建了一个存档页面,以显示来自“property_sales”自定义帖子类型的帖子 这是完整的模板 <article <?php post_class(); ?>> <header> <h2 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a><
<article <?php post_class(); ?>>
<header>
<h2 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
</header>
<div class="location">
<?php the_field('location')?>
</div>
<div class="photoframe">
<a href="sales"><img class="responsive" src="<?php the_field('property_image')?>" /></a>
</div>
<div class="price">£
<?php the_field('price')?>
</div>
<div class="entry-summary">
<p>Added on <?php get_template_part('templates/property-meta'); ?></p>
</div>
<div class="rightmovelink">
<a href="<?php the_field('link')?>" target="_new">View Full Listing</a>
</div>
<div class="clear">
</article>
£
加上
我想知道我需要在标签中添加什么代码才能链接到每个图像关联的帖子 试试这个
<div class="photoframe">
<a href="<?php the_permalink(); ?>"><img class="responsive" src="<?php the_field('property_image')?>" /></a>
</div>
向我们展示完整代码这是循环中的还是添加了完整模板部分的单个页面-这是您需要看到的吗?在这一刻,它指向“sales”slug,但这只是将其链接回页面,而不是post。我的回答是,你要求在图像上有一个post链接吗?