在@toscho的帮助下指出get_post();
, 我能吐出一个。带有空白模板的csv。起初,我的内存限制问题是数据量的b/c,所以我将站点移动到本地,并能够使用get_post();
其要点如下:
<ol>
<?php
global $post;
$args = array(
\'numberposts\' => -1,
\'orderby\' => \'post_title\',
\'order\' => \'DESC\',
\'post_type\' => \'prospects\',
\'post_status\' => \'publish\'
);
$myposts = get_posts( $args );
foreach( $myposts as $post ) : setup_postdata($post); ?>
<li><?php echo $post->ID ?>, <?php the_title(); ?>, <?php echo get_field(\'prospect_profile_image\'); ?>, <?php echo get_field(\'height\'); ?>, <?php echo get_field(\'weight\'); ?>, <?php echo get_field(\'born\'); ?>, , <?php echo get_field(\'email\'); ?>, <?php echo get_field(\'phone\'); ?>, <?php echo get_field(\'street_address\'); ?>, <?php echo get_field(\'city\'); ?>, <?php echo get_field(\'state\'); ?>, <?php echo get_field(\'zip_code\'); ?>, <?php echo get_field(\'position_1\'); ?>, <?php echo get_field(\'position_2\'); ?>, <?php echo get_field(\'bats\'); ?>, <?php echo get_field(\'throws\'); ?>, <?php echo get_field(\'fathers_name\'); ?>, <?php echo get_field(\'mothers_name\'); ?></li>
<?php endforeach; ?>
</ol>
起初,我使用订单列表来确保我得到了所有记录。