用wordpress建站,如何调用当前分类下所有文章,下面是wordpress获取当前分类下所有文章列表的代码:
代码如下:
<?php
$singleurl = get_permalink($post_id);
$cats = wp_get_post_categories($post->ID);
if ($cats) {
$args = array(
'category__in' => array( $cats[0] ),
'showposts' => 50,
'caller_get_posts' => 1
);
query_posts($args);
if (have_posts()) : while (have_posts()) : the_post(); update_post_caches($posts); ?>
<li<?php if(get_permalink($post_id)==$singleurl){?> class="video-curry"<?php }?>><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endwhile; else : ?>
<li>暂无文章</li>
<?php endif; wp_reset_query(); } ?>
wordpress利用TAG标签的ID来获取这个标签下的所有文章
上面是“wordpress调用当前分类下所有文章(代码介绍)”的全面内容,想了解更多关于 wordpress 内容,请继续关注web建站教程。
当前网址:https://ipkd.cn/webs_2407.html
workflows工作流
一幅骨架坐在公园的长椅上
五彩斑斓的蛇状飞鸟
一轮月亮悬挂在树上的天空中ComfyUI工作流
在白雪覆盖的广阔平原上两只可爱的小猫
树上一个快乐的猕猴桃ComfyUI工作流
基础扩图comfyui工作流
嘴唇丰满的漂亮女人
一只迷人的黑豹ComfyUI工作流
猜你喜欢
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

用canvas实现画板涂鸦效果
3D彩色卡片
如何利用css3+js做一个下雨效果
js导出excel插件(兼容mac电脑Numbers表格)
SVG路径动画效果
css3做一个风雨雷电天气动态图标
css3卡片动态滑动效果
利用js+css3做一个小鱼游泳特效










