我想发布一个由我网站上有许多关键字的图片组成的图库。喜欢来自某个地点或时间。我想使用wordtion选项或wordpress中的描述选项。图片将包含更多关键字,例如:“位置”“日落”。我尝试将此What is the function got get all the media files wordpress?与https://wordpress.org/ideas/topic/functions-to-get-an-attachments-caption-title-alt-description结合使用,但我无法让它们正常工作。你能帮我吗。但我是一个新手,所以你能解释一下在function.php中要写什么以及在page-name.php中写什么
LE: <?php $attachment_meta = wp_get_attachment(wp_get_attachement_id()); ?>
<?php if ($attachement_meta[caption] == 'Ceahlau' ) ?>
echo do_shortcode('[gallery columns="4" link="file" ids=" <?php wp_get_attachement_id() ?>"]')
<?php else: ?>
<?php endif; ?>
这就是我现在page-name.php
答案 0 :(得分:0)
<?php $attachment_meta = wp_get_attachment(wp_get_attachement_id()); ?>
<?php if ($attachement_meta[caption] == 'Ceahlau' ) ?>
echo do_shortcode('[gallery columns="4" link="file" ids=" <?php
wp_get_attachement_id() ?>"]')
<?php else: ?>
<?php endif; ?>'
This is what i have now in my page-name.php
答案 1 :(得分:0)
var array3 = [1,2,3,4,5]
//assuming array1 as [1,2,3,9,8,7,4,5]
let array4 = array1.filter({array3.contains($0)})
print(array4) //will give you desired ordered array