滚动至顶部

页面性能信息:

页面加载时间: 0.394 秒

内存使用: 24 MB

数据库查询次数: 53

加载的样式表数量: 395

加载的脚本数量: 239

页面图片信息:

图片ID图片标题类型关联文章URL地址预览
978image-20250919214508867文章缩略图12-23-CSS伪元素解释https://haoyelaiga.com/wp-content/uploads/2025/10/image-20250919214508867-150x150.png

总计图片数量: 1

WordPress Post 文章常用函数参考表:

函数名称用途语法示例返回值
the_title()显示文章标题the_title(); // 直接输出
echo get_the_title(); // 获取标题
无返回值(直接输出) / 字符串
the_content()显示文章内容the_content(); // 显示完整内容
the_content("继续阅读..."); // 自定义more标签
无返回值(直接输出)
the_excerpt()显示文章摘要the_excerpt(); // 显示摘要
echo get_the_excerpt(); // 获取摘要
无返回值 / 字符串
the_permalink()显示文章永久链接the_permalink(); // 直接输出链接
echo get_permalink(); // 获取链接
无返回值 / URL字符串
the_date()显示文章发布日期the_date(); // 默认格式
the_date("Y-m-d H:i:s"); // 自定义格式
无返回值(直接输出)
get_the_date()获取文章发布日期echo get_the_date(); // 默认格式
echo get_the_date("Y年m月d日");
日期字符串
the_author()显示文章作者the_author(); // 显示作者名
echo get_the_author(); // 获取作者名
无返回值 / 作者名字符串
has_post_thumbnail()检查是否有特色图片if(has_post_thumbnail()) { ... }
has_post_thumbnail($post_id)
true/false
the_post_thumbnail()显示特色图片the_post_thumbnail(); // 默认尺寸
the_post_thumbnail("thumbnail");
无返回值(直接输出HTML)
get_post_meta()获取文章自定义字段get_post_meta($post_id, "key", true);
get_post_meta(123, "_price", true);
字段值 / 数组
get_the_category()获取文章分类$cats = get_the_category();
foreach($cats as $cat) { echo $cat->name; }
分类对象数组
get_the_tags()获取文章标签$tags = get_the_tags();
if($tags) { foreach($tags as $tag) { ... } }
标签对象数组 / false
get_post()获取文章对象$post = get_post(123);
echo $post->post_title;
WP_Post对象 / null
wp_get_post_terms()获取文章分类法项目wp_get_post_terms($post_id, "category");
wp_get_post_terms(123, "product_cat");
项目对象数组
get_post_status()获取文章状态echo get_post_status(); // publish
get_post_status($post_id);
状态字符串

提示: 带有"the_"前缀的函数通常直接输出内容,带有"get_"前缀的函数返回值需要用echo输出。

ID 7014 图片详细信息:

ID为7014的图片不存在或不是有效的附件。

API 返回错误状态码 402
响应内容:{"error":{"message":"Insufficient Balance","type":"unknown_error","param":null,"code":"invalid_request_error"}}