درود
حل تمرین:
//using a WP_Query to retrieve a list of post titles and URLs to be displayed
$args = array(
'post_type' => 'post',
'posts_per_page' => -1,
'no_found_rows' => true,
'update_post_meta_cache' => false,
'update_post_term_cache' => false
);
$query = new WP_Query( $args );
if ( $query->have_posts() ) {
while ( $query->have_posts() ) {
$query->the_post();
echo '<a href="' . get_permalink() . '">' . get_the_title() . '</a><br>';
}
}
wp_reset_postdata();
ئيإ