Gho*_*ost 0 php wordpress concatenation
function recent_posts_function() {
$call_number = the_field('call_number');
$book_author = the_field('book_author');
$publisher = the_field('publisher');
$edition = the_field('edition');
$description = the_field('description');
$subjects = the_field('subjects');
query_posts(array('post_type' => 'model', 'orderby' => 'date', 'order' => 'ASC' , 'showposts' => 5));   
if (have_posts()) :
  while (have_posts()) : the_post();
        echo
        '<div class="book-list-section">'
            '<h3>' .$call_number '</h3>'                
        '</div>';
    endwhile;
endif;
wp_reset_query();  
}
这是wordpress但我的问题是我无法正确连接HTML代码并回应它.请帮助我,我搜索并尝试但仍然不知道...
function recent_posts_function() {  
 query_posts(array('post_type' => 'model', 'orderby' => 'date', 'order' => 'ASC' , 'showposts' => 5));   
 if (have_posts()) :
    while (have_posts()) : the_post();
        echo 
        '<div class="book-list-section">
            <h3>'.the_field(call_number).'</h3>
            <p><span>'.get_the_title().'</span></p>
            <br  class="clear" />
            <p>' .the_field('book_author').'</p>
            <br class="clear" />
            <p>' .the_field('publisher').'</p>
            <p>' .the_field('edition'). '</p>
            <p>' .the_field('description').'</p>
            <br class="clear" />
            <p>' .the_field('subjects'). '</p>
        </div>';
    endwhile;
 endif;
 wp_reset_query();    
 }
它正在工作,但它不在div内......为什么会这样?"get_the_title()"只是DIV中的那个......这有什么问题?
你有一些不必要的引号,并在$call_number变量之后错过了一个连接运算符.
正确的方式...
echo '<div class="book-list-section"><h3>'.$call_number.'</h3></div>';