converting from query_posts
-
Need to change my code from query_posts to use get_posts, however, I’m struggling to change and keep the way it currently displays info.
You can see some of the code here: https://pastebin.com/UqmdyYmS containing what I need to convert.
I then echo the info out later on in the page like this:
<h3><?php echo $blog_title[0]; ?></h3> <p><?php echo $blog_excerpt[0]; ?></p> <?php echo $postdata[0]; ?>
Changing [0] for [1], [2] etc… to display different content.
The examples on wordpress functions page has a foreach function which I dont think I need, or do I ?
Thanks.
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘converting from query_posts’ is closed to new replies.