WordPress en iyi uygulamaları kullanarak, wp-blog-header.php yükleme olmamalı, ama yerine wp-load.php, bu özellikle bu amaç için oluşturulmuş gibi.
Bundan sonra, kullanımı ya da the WP_Query object ya da get_posts(). WP_Query kullanmak için nasıl bir örnek WordPress kodeksine üzerine The Loop sayfasında mevcuttur. Eğer dışarıdan WordPress bunları kullandığımız takdirde, bu birini kullanarak önemli değil de, örneğin GET parametreleri gibi müdahale şey daha az şans var.
Örneğin, WP_Query kullanılarak:
<?php
$my_query = new WP_Query('showposts=3');
while ($my_query->have_posts()): $my_query->the_post();
?>
<h1><a href="<?php the_permalink() ?>"><?php the_title() ?></a></h1>
<?php endwhile; ?>
Veya get_posts kullanarak ():
<?php
global $post;
$posts = get_posts('showposts=3');
foreach($posts as $post) :
?>
<h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
<?php endforeach; ?>
Bu yardımcı olur umarım! :)