我尝试在我的wordpress网站上显示我的Cover图像,标题,PDF和PDF描述,但是没有运气。只有标题出现在网站上。谢谢
//Start the bulletin function to list all items
function bulletin_func( $atts ) {
$args = array(
'post_type' => 'focus-bulletin', // The custom post type we want to query and display posts from
'posts_per_page' => -1 // -1 = all posts
);
query_posts($args); // Query the post type set in the args array
if ( have_posts() ) :
while ( have_posts() ) :
the_post(); // WP post loop to init post data
?>
<div class="bulletin-wrapper">
<?php
echo types_render_field("cover-image",
array( "alt" => get_the_title(),
"width" => '100%',
"height" => 'auto',
"proportional" => "false"
));
echo get_the_title();
echo types_render_field("issue-pdf");
echo types_render_field("issue-description");
?>
</div>
<?php
endwhile;
wp_reset_query();
endif;
}
add_shortcode( 'bulletin', 'bulletin_func' );
//End the bulletin function to list all items