傻大憨

WP根据文章ID判断是否有相册并调用

根据wordpress文章ID判断是否有相册并调用,不废话直接上代码,在需要显示的位置调用下面代码即可。

$post_id = 88;
$has_gallery = ( count( get_post_galleries( $post_id, false ) ) > 0 );
if ( $has_gallery ) {
    echo "This post has a gallery.";
} else {
    echo "This post does not have a gallery.";
}
Published
Categorized as 建站知识 Tagged

By 傻大憨

shadahan.com是一个关注跨境电商、创业话题的网站。

WordPress模板制作学习笔记

从今天正式开始

隐藏wordpress后台登陆地址

把wordpress后台登陆地址隐藏起来,网站会更安全。

WordPress the_category与single_cat_title

分类名称的两种调用方法

WordPress二次开发中常用到的一些变量和函数

WordPress二次开发中常用到的一些变量和函数,实际上WordPress还提供了许多其他有用的变量和函数,开发者可以根据具体的需求进行学习和使用。

东南亚跨境电商的发展潜力

东南亚跨境电商市场凭借其快速成长的市场规模、年轻且多元化的消费群体、政府政策支持以及完善的基础设施建设,展现出巨大的发展潜力。

The Best WordPress Chinese Theme Simplified Website WordPress Theme

If you are looking for an excellent WordPress Chinese theme, Jianzhanpress.com is undoubtedly a good option worth considering.