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
- Resetting post data to previous loop in nested loops
- Pagination returns 404 after page 20
- Make loop display posts by alphabetical order
- WP_Query: query posts by ids from array?
- get custom post type by tag
- How to get order of posts?
- pre_get_posts with get_posts
- Executing Queries in tag.php
- Query Custom Meta Value with Increment
- Identify which loop you are hooking into; primary or secondary?
- Group posts by custom field
- Trying to list out child pages with WP_Query
- Transient pagination not working properly
- get_posts() seemingly ignoring post_type
- Woocommerce custom loop to show all the products [closed]
- Exclude first 5 posts of specific categories in the main loop
- How to bring specific post to front of wordpress loop?
- How to show the posts of some category first, and then all other
- Why execute the_post()?
- Pagination stops at page 6
- Paginated HTML Sitemap
- Posts loop with pagination on a single post page
- Why does the_content not work like others for a set post id?
- WP_Query Order by Specific Post ID First
- How to limit total number of posts in wp query loop?
- How to change posts order on Category and Tag archives?
- Using one WP_Query object within the loop of another WP_Query object
- Pagination is broken and I need help fixing it
- WP_Query on custom field and order results
- how to merge a WPQuery array with a PHP array and use the Loop to Output the result
- How to display 7 most recent days of posts?
- How to vary post loop results layout and resume?
- Create A Loop With A Variable Number of Posts For Each Bootstrap Row?
- Get a post from other loop each n-posts in the main loop
- Loop returning only 1 result
- Where is the WP_Query instance instantiated (when working with themes)?
- WP_Query create html structure
- WordPress Loop and $post
- Show post number in widget loop
- posts_per_page not working for first page of pagination
- Loop Performance > JSON files vs. WP_Query vs. REST API
- Excluding pages in WP_query using ACF
- reset to main loop doesnt work
- Some doubts about how the main query and the custom query works in this custom theme?
- Search form not working with custom query?
- Post loop for all taxonomy terms
- WordPress ignoring LIMIT / posts_per_page despite being in wp_query
- Stuck in the query loop
- Conflict with get_posts and the_content
- Custom taxonomy.php not working
- different for loop if screen resolution < 1000px
- Transient api Caches confused
- Can I add generic numbering HTML classes to items as a loop runs?
- sort and display posts by custom field (wp-query and the loop))
- Conditional operator OR not working with custom fields
- Should I reset $wp_query?
- inserting content of 1 Post to in another with a template hierarchy
- Pagination for custom loop on custom page template is not displaying anything
- Filtering by multiple conditions in the loop
- How to access $wp_query object from array of posts given by get_posts?
- Display all attached image of every post of custom post type and link to original post
- Writing less unnecessary code with WordPress
- WordPress Queries Not Working?
- Filter subpages in while loop from WP Query object
- Use have_posts() with array of post results retrieved by $wpdb->get_results
- Custom query does not find pages
- How to sort by most watched in X days/months
- Magazine style frontpage with multiple categories/loops and no duplicate posts
- How can I use arrays and a foreach to generate many lists with WP_Query?
- How to use custom page for all posts with custom url, call another directory?
- display ACF repater field in archive page
- WP_Query breaking the loop in a nested loop
- Show a message if there are no active posts in category
- Related posts queries
- What’s causing an infinite loop?
- display the children of the post using the current page as the main parent
- Display 3 levels of categories on page
- Paging works correctly on local version, but not live?
- pages shortcode filtering by category
- Custom post type loop error: Trying to get property of non-object
- How to add in WP_Query to every 3 posts displayed? [duplicate]
- Display three sequential posts on each page load, without repeating previous
- How to make a wordpress loop file that displays posts based on certain conditions
- WP_Query secondary query failing
- Custom loop – Isolating post meta output depending on current query taxonomy terms
- Issue in If else condition [closed]
- Pagination not working with WP_QUERY
- Sorting is not working in WordPress WP_Query
- Add custom WP_Query after the first 3 posts
- How do I display posts with specific value in a custom field into my loop?
- Order by multiple meta keys on wordpress
- wp_query pagination links producing 404
- Display First posts without the default featured image
- Pagination problem with multiple loops on the same page
- Can’t seem to get an else statement correct? [closed]
- Output ACF field dynamicaly within a taxonomy loop [closed]
- How do I split a large query with a semi-expensive function included into multiple smaller queries
- Custom query for certain post type OR another post type with a certain category
- Splitting query results, on the frontend, into separate sections based on meta value without multiple loops?