WP Query

site 1

url : WP Query

post 또는 page를 요청하는 레퍼런스

<?php

// The Query
$the_query = new WP_Query( $args );

// The Loop
if ( $the_query-&gt;have_posts() ) {
    echo '<ul>';
        while ( $the_query-&gt;have_posts() ) {
            $the_query-&gt;the_post();
            echo '<li>' . get_the_title() . '</li>';
        }
    echo '</ul>';
} else {
// no posts found
}
/* Restore original Post Data */
wp_reset_postdata();
Share this

Leave your question or feedback

따뜻한 말한마디가 블로거를 춤추게 합니다. 이메일 주소는 공개되지 않습니다.