Php 从类别收集的帖子列表中删除链接
我有属于某个类别的帖子的链接列表。该名单载于各职位。生成列表的代码如下所示:Php 从类别收集的帖子列表中删除链接,php,regex,wordpress-theming,wordpress,Php,Regex,Wordpress Theming,Wordpress,我有属于某个类别的帖子的链接列表。该名单载于各职位。生成列表的代码如下所示: <?php $sel_works = new WP_Query('category_name=Selected_Works&showposts=-1'); while($sel_works->have_posts()) : $sel_works->the_post(); ?> <a href="<?php the_permalink() ;?>"><?p
<?php
$sel_works = new WP_Query('category_name=Selected_Works&showposts=-1'); while($sel_works->have_posts()) : $sel_works->the_post();
?>
<a href="<?php the_permalink() ;?>"><?php the_title(); ?></a><span class="CatSep"> / </span></li>
<?php endwhile; ?>
/
我想知道是否有办法删除列表中指向我们已经发布的帖子的链接。我很难定义条件,非常感谢您的帮助。
<?php
$current_id = get_the_ID();
$query_settings = array(
'category_name'=>'Selected_Works',
'posts_per_page'=>-1,
'post__not_in'=>array($current_id)
);
$sel_works = new WP_Query($query_settings);
while($sel_works->have_posts()) : $sel_works->the_post();
?>
<a href="<?php the_permalink() ;?>"><?php the_title(); ?></a><span class="CatSep"> / </span></li>
<?php endwhile; ?>
/