no idea what the problems actually are, but from looking at the code, I woud suggest:
a:
the while (have_posts()) :
should be while ($the_query->have_posts()) :
b:
you would need to increment the counter:
<?php $count = $count + 1; ?>
c:
the endif;
of the loop might be missing after the endwhile;
– at least it is not shown in the posted code section.
Related Posts:
- How to fix pagination for custom loops?
- Remove the Homepage Query
- Is `query_posts` really slower than secondary query?
- Are there any scenarios where the query_posts may be used?
- Transient not working for custom loops
- post loop causes wp_users and wp_usermeta DB queries for each users
- get_the_foo() in the loop – does it perform another query?
- If No Search Results, Show Posts from Alternate Search Query
- How to Loop within a Loop (Display Children and then Grandchildren)
- Loop posts only excluding first post
- Loop after page content
- A loop with all articles with certain text strings in tags
- Display most viewed post from last 30 days is not working correctly
- Query posts if meta key starts with
- 3 Posts in Loop, Show Stickies First
- How to go about combining dropdowns / filter queries?
- Query reset problem or flawed code to enable custom post type query
- Query last updated posts (posts updated in the last 24 hours)
- Conditional query that displays on Woo product attribute pages
- How do I use AJAX Query in my posts loop?
- woocommerce get_price_html not pulling in correct price
- How to fix pagination for custom loops?
- How can I paginate this?
- How to display posts by vote count and if no value continue with latest posts with no votes?
- How to fix pagination for custom loops?
- Split wordpress loop to multiple layouts
- Making a query to the DB using same parameters of loop
- Loop inside query
- get_delete_post_link() inside Loop stubbornly returns nothing
- loop inside the foreach
- Query posts only with actual text content (not including shortcode or images)
- Exclude posts based on an array
- Loops for cat links not looping for wordpress site
- How do I set the Stewart Search Template to return only published posts in the result
- Trying to get all links in my posts
- Custom Query with Sticky Posts
- Build a Page which shows the Oldest Post with specific Custom Field Value
- Query posts and display all dates in repeater field in chronological order
- How to fix pagination for custom loops?
- Get featured image outside the loop using foreach
- Alternative layout the loop
- Show posts by tags excluding current post
- Strange problem with wp_get_attachment_image_src database (db) query count
- Next 10 posts data of currently viewing post in blog page
- How to fix pagination for custom loops?
- How to fix pagination for custom loops?
- How to fix pagination for custom loops?
- Get query result before posts are displayed?
- Combine Query and Select Database to create directory loop
- WordPress loop: Display if posts exist
- wordpress showing all posts instead of date range
- Multiple loop with pagination in same page
- Query Loop Block: possible to restrict just child pages?
- Use Base-URL with Query-Loop
- Jquery Slider for profile template
- Should I use loop in the single.php file?
- wp_list_categories: get latest featured_image of category
- Specific Loop For 2 Within Each
- Exclude filter on front page
- Check if date of post is yesterday
- Exclude first 2 posts with meta_key from loop
- Make a custom loop inside single.php with pagination
- Why do I get `Call to a member function have_posts() on a non-object `? [closed]
- Loop and Page template : my WP_query don’t take args
- How to split a loop into two columns
- Category Ajax call
- query_posts() ALWAYS displays something?
- Transient loop issue
- popular post weekly and monthly
- Get single post from tags array
- Get all posts including sticky ones with get_posts(),setup_postdata(), and foreach loop?
- Latest Post Styled Different Than other Posts
- Woocommerce: How to display product price [closed]
- First x post with another template then the others
- Add “showing posts x to x of y” in custom post type paginated loop
- Display a single category in blog section
- Query Nopaging action not having effect
- Getting page slug
- How to get pagination to work with 2 wordpress loops
- How is WordPress changing the content markup?
- Inserting CPT and static content at every X post, is this possible?
- loop through posts and display inserted media and post title as a link
- Exceprt not displaying
- Add File Attachment Name and URL into Javascript
- List ALL posts by author on author archive
- Get current taxonomy and display query accordingly
- Add custom post type to query
- Can’t limit posts_per_page in loop
- Slug is changing when I use WP_Query in a metabox of a post
- Can’t print out returned value
- change the_content images for different sizes (Desktop, tablet, mobile)?
- WordPress Group By Problem
- Home page loop with pagination problem
- WooCommerce custom loop pagination on front page
- Eliminate duplicates in a foreach loop [closed]
- I want the first post on my home page to be lengthier than the rest (example included)
- Loop with Custom Post Type Taxonomies and Interstitial Code
- Question about custom plugin
- loop mix my child-category and parent-category
- How can you make it so the comment box shows on some pages or posts but not all?