<?php get_post($post_id, $output); ?>
$pid = 158; get_post($pid); //如果像get_post(158);这样调用则会报错
<?php $mypost_id = 158; $post_id_158 = get_post($mypost_id, ARRAY_A); $title = $post_id_158['post_title']; ?>
<?php $args = array( 'numberposts' => 5, 'offset' => 0, 'category' => , 'orderby' => 'post_date', 'order' => 'DESC', 'include' => , 'exclude' => , 'meta_key' => , 'meta_value' => , 'post_type' => 'post', 'post_mime_type' => , 'post_parent' => , 'post_status' => 'publish' ); $posts_array = get_posts( $args ); ?>
<?php $args = array( //需要提取的文章数 'numberposts' => 10, //以第几篇文章为起始位置 'offset' => 0, //分类的ID,多个用逗号将分类编号隔开,或传递编号数组,可指定多个分类编号。 //大部分 CMS 使用该函数的重点。 'category' => , //排序规则(注1) 'orderby' => 'post_date', //升序、降序 'ASC' —— 升序 (低到高) 'DESC' —— 降序 (高到底) 'order' => 'DESC', //要显示文章的ID 'include' => , //要排除文章的ID 'exclude' => , //自定义字段名称 'meta_key' => , //自定义字段的值,配合上一个参数,来选择显示符合自定义字段数值的文章。 'meta_value' => , //post(日志)——默认,page(页面), //attachment(附件),any —— (所有) 'post_type' => 'post', //文章的 mime 类型 'post_mime_type' => , //要显示文章的父级 ID 'post_parent' => , //文章状态 'post_status' => 'publish' ); ?>
<?php
$posts_rand = get_posts('numberposts=3&orderby=rand');
?>
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有