我尝试过显示许多帖子类型(用逗号分隔),但都不起作用。有没有办法做到这一点?
$args = array( \'numberposts\' => \'5\', \'post_type\' => \'cpt1, cpt2, cptn\');
$recent_posts = wp_get_recent_posts( $args );
感谢您的投入。我尝试过显示许多帖子类型(用逗号分隔),但都不起作用。有没有办法做到这一点?
$args = array( \'numberposts\' => \'5\', \'post_type\' => \'cpt1, cpt2, cptn\');
$recent_posts = wp_get_recent_posts( $args );
感谢您的投入。将post类型用作数组。
$args = array(
\'numberposts\' => \'5\',
\'post_type\' => array(\'cpt1\', \'cpt2\', \'cptn\')
);
$recent_posts = wp_get_recent_posts( $args );
我是WordPress的新手;我刚开始学习WordPress。我想把风格联系起来。函数中的css。php,但我无法解决这里可能存在的问题。谁能给我指出正确的方向吗?指数php<?php get_header(); ?> <?php if ( have_posts() ) { while ( have_posts() ) { the_post();