<?php
$id = get_the_ID();// 文章当前的 id
$title = get_post($id)->post_title;
$my_data = get_the_time('Y-m-d');
$my_content = get_post($id)->post_content;
?>
本文介绍了一种使用PHP从当前文章中获取ID、标题、发布日期及内容的方法。通过简单的PHP代码实现, 不仅可以轻松地获取到文章的基本信息, 还能够为后续的内容处理提供便利。
<?php
$id = get_the_ID();// 文章当前的 id
$title = get_post($id)->post_title;
$my_data = get_the_time('Y-m-d');
$my_content = get_post($id)->post_content;
?>
841

被折叠的 条评论
为什么被折叠?