I have a simple PHP script using WP APIs that is called not from a browser but from the command line, as:
php -f scriptname.php
It’s working, but something odd happens with the loop. I get the top 5 instances of the_title() and the_content_rss(), but I get the top 20 instances of the_permalink, as if the the_permalink is somehow not part of the same loop. Suggestions welcome, thanks.
if ($posts) : foreach ($posts as $post) : start_wp();
the_content_rss(”, TRUE, ”, 100);
_e(‘Sorry, no posts matched your criteria.’);
- The topic ‘Loop question’ is closed to new replies.