在查询中插入来自wordpress admin的类别ID

时间:2016-08-12 21:46:55

标签: php wordpress

我想在我的主页上显示特定类别的帖子,但我想从管理主题选项中回显此类别ID或slug,所以我制作了主题选项,我可以使用此代码回显任何内容

<?php $news1 = get_option("mytheme_news1"); echo $news1; ?>

问题是我想在此代码中使用上面的代码而不是“10”(类别ID)。

<?php
$args=array(
'category__in' => ?> 10 ,
'posts_per_page' => 15
);
$videos = new WP_Query($args);
if($videos->have_posts()) : while($videos->have_posts()) : $videos->the_post(); ?>

0 个答案:

没有答案
相关问题