简体   繁体   English

Wordpress下一个/上一个发布按钮自定义HTML

[英]Wordpress next/previous post button custom HTML

I want to show a field from ACF (Advanced Custom Fields) in the link to the next/previous post. 我想在下一个/上一个帖子的链接中显示ACF(高级自定义字段)中的一个字段。 And i can't figure out how to show this. 而且我不知道如何显示这一点。 For as for as i can find ACF field can only be displayed with PHP and i can't display PHP inside the code i have now. 就我所知,ACF字段只能用PHP显示,而我现在无法在代码中显示PHP。

Does anyone know how to show this without PHP or how to add PHP to my code? 有谁知道如何在不使用PHP的情况下显示此信息,或者如何在我的代码中添加PHP?

I currently use this code 我目前正在使用此代码

<?php previous_post_link( '%link', '<div id="vorigePostKnop"><i class="fa fa-play"></i>  <div id="venster">%title<br>%date  </div>  </div> ' ); ?>

English isn't my first language. 英语不是我的母语。 I hope you can understand. 我希望你能够明白。

Use the get_field function to get the field as a string, as opposed to outputting it with the_field : http://www.advancedcustomfields.com/resources/get_field/ 使用get_field函数以字符串形式获取该字段,而不是使用the_field输出该the_fieldhttp : //www.advancedcustomfields.com/resources/get_field/

Then just concatenate it into your link: 然后将其串联到您的链接中:

<?php previous_post_link( '%link', '<div id="vorigePostKnop"><i class="fa fa-play"></i>  <div id="venster">%title<br>%date ' . get_field('uitgelichteAfbeelding') . '</div>  </div> ' ); ?>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM