Not sure how your final html should look, but I guess it’s:
<ul>
<li>...</li>
<li>...</li>
<li>...</li>
</ul>
In that case, you should move the ul
element outside the while loop and your code should look like this:
<ul>
<?php while ($agendaHome->have_posts()) {
$agendaHome->the_post(); ?>
<li>rest of the code goes here</li>
<?php } ?>
</ul>
Also add apostrophes around ASC at the order parameter.
'order' => 'ASC'
Related Posts:
- active link for most recent post on vertical tabs
- How to delete widget in WordPress?
- View related categories in order of posts
- modifying the loop multiple times with arguments passed through ajax to wp_query
- WP_Query causing links to not work
- Continue loop after $queryObject
- query_posts() doesn’t seem to be called in my page
- Some doubts about how the main query and the custom query works in this custom theme?
- display post multiple times based on array of dates
- Retrieving category pages from subcategory returns empty sets
- How to make a wordpress loop file that displays posts based on certain conditions
- 2 Loops on one page – pagination of 2nd loop ignore array of excluded posts
- Pagination returns 404 after page 20
- Problems with WP_Query, Loop, a condition and Posts per Page
- Ordering Posts by parent category, name ascending
- WP_Query secondary query failing
- Declare inline background image in functions.php
- custom query – offset to pagination
- WP_query for posts with same post type AND same post category
- How to solve this script problem in theme directory?
- Custom loop – Isolating post meta output depending on current query taxonomy terms
- WP_Query a custom field value bringing back 0 results
- Set Transient on CPT
- Issue in If else condition [closed]
- Create multiple sections for all categories and then queries all the posts for each of those categories
- Pagination not working with WP_QUERY
- Show posts in category
- Both WP_Query and get_posts returning 1 post
- Custom search (wp query by custom fields)
- Iterate through ID’s in loop
- Sorting is not working in WordPress WP_Query
- Add custom WP_Query after the first 3 posts
- Load 3 posts in flexslider slide [closed]
- Loop through multiple custom fields with increasing number
- WP_Query for attachments without duplicating post_parent and displaying tagged image
- Different number of posts showing in development vs production server
- Issue with WP_Query (need a array of selected ID’s)
- How do I display posts with specific value in a custom field into my loop?
- List ALL posts within last week from current category on category page
- An archive page without post format (just standard post)
- Custom post type archive organized by category
- Limit the number of posts from a specific category on index.php
- wp_query display posts based on day
- Multiple wp_query loops showing first 5 posts on all pages instead of older posts[Resolved]
- Sorting Posts Based On Meta Value Using AJAX
- Next / previous posts link doesn’t show up with Posts 2 Posts
- How to exclude posts ordered by comment_count from subsequent wordpress loops using WP_Query?
- Order by multiple meta keys on wordpress
- No content found on page 2 of pagination with 1 post per page
- meta_query dates from an array
- Creating array to compare custom field values
- wp_query pagination links producing 404
- Converting an existing query_posts to WP_Query
- loop through custom post types with meta data
- Display First posts without the default featured image
- Pull Instagram images into an existing loop?
- Loop being strainge
- Using Query In Post Type Archives
- Multiple loop for “featured” items returns wrong posts
- $query conflicting with other queries in the same page
- How ‘secure’ are loops?
- Pagination in custom query not working [duplicate]
- Multiple loops on index page with sticky post and pagination
- Pagination problem with multiple loops on the same page
- Problem with WP_Query sort
- WordPress Post Looping? [duplicate]
- How to do a loop inside a loop?
- Carousel Loop only duplicating
- Remove 5 latest posts from the loop
- Exclude post formats in custom loop
- Stylesheet won’t load even when linked
- Get author meta data with no published posts in author.php?
- Query for page content, and query for posts on the same page?
- Can’t seem to get an else statement correct? [closed]
- Help with showing text when something is entered in my search bar
- How to write a query-function as a query-shortcode?
- How to show featured post first, then separate loop for other posts
- Output ACF field dynamicaly within a taxonomy loop [closed]
- Main loop querying current template’s info only in custom category archive pages, not my posts
- Print post data inside loop using theme content template
- Show linked products using wp query and woocommerce
- Standard Loop – wp_query
- tax_query not working properly with get_posts
- First post outside of loop, homepage only?
- the_excerpt() not working in custom archive
- How can I display sticky posts at first in wp_query?
- How do I split a large query with a semi-expensive function included into multiple smaller queries
- Custom Wp_query loop takes very long
- Woocommerce set loop_shop_columns to be 3 in the main shop page loop only and 4 otherwise
- Prevent WordPress loop from displaying similar post titles
- Custom query for certain post type OR another post type with a certain category
- Query All Posts: Either Display Most Recent or One with Particular ACF Value Chosen
- Show number of posts AND number on current page (cannot make it work)
- How to get rid of extra Untitled Article in html5 document outline when using new WP_Query?
- Custom WordPress loop, articles not in same order as Array
- after refresh the id that shows correct in first time click, changes to 1
- Pagination only showed when no category is set in wp_query
- WP_query shortcode inside acf Repeater breaks the repeater loop
- Unexpected number of loops in while
- Splitting query results, on the frontend, into separate sections based on meta value without multiple loops?