i use this code in my portfolio http://pocketapps.co/
<?php $args = array(
//your argument code
);
query_posts($args);?>
<ul>
<?php
$ls=0;
while ( have_posts() ) : the_post();
?>
<?php if($ls%2==0): echo '</li><li>'; endif; ?>
<div class="app">
//your code here
</div>
<?php
$ls++;
endwhile;
wp_reset_query();
?>
</ul>
Related Posts:
- Query multiple custom post types in single loop
- How to change post count in wordpress loop?
- spliting posts into two columns
- How to get to a specific position in wp_query?
- Increase offset while looping
- How to add div blocks after certain set of post
- How to overwrite orderby with add_query_var
- WordPress query undefined offset in loop
- Issue with custom loop in Archive page
- Limit tags shown in post
- Echo array value
- Display articles with a different template in the home page | Solved |
- For each 3 posts, show a different post type
- divide custom field values in div every two values
- Problems With Query and/or Template Part and/or PHP
- Count the number of matching post names in foreach loop
- the_date() not working
- Build a content and excerpt grid loop with paging and options for # of posts
- How to loop over custom fields in a page template?
- How to sort results from a custom database table
- Two posts in same div – WP loop
- Woocommerce, recognize the loop of related products
- Use two WP Query in template
- Easiest way to show total number of subpages
- Count number of published posts by type
- Output 2 items within the Loop
- WordPress – query 5 posts with a specific post in top
- How to speed up a wordpress function with multiple loops?
- How can I add pagination and how can I change thumbnail size?
- $wpdb->flush(); breaks the loop
- How to get a list of all possible values of a specific user meta key?
- Use object in template part
- Get first URL from post content
- Accessing the database from a plugin outside of action hooks
- Show css depending on activity type in BuddyPress activity-loop [closed]
- Set WP_query ‘order’ option by another tables value
- Iterate through posts based on array of categories
- How to add condition in wordpress loop? [closed]
- Alert Bar section within WP loop is displaying even though there are no posts
- Load wordpress content in other domain
- WordPress SQL injection
- How to list commenters and days since last commented
- PHP Warning: strip_tags() expects parameter 1 to be string?
- Echo a shortcode div after every 3 posts
- How to avoid duplicates when creating recent network posts
- variable value disappears in a second loop
- Why my loop isn’t working? [closed]
- Only show first image in foreach loop
- Get all posts as an array ID => Name
- How to get post ID from button and pass title to Modal
- Wpdb get->results to out the the month from the db
- Display child page content of a specific parent on home page
- Do not duplicate posts with multiple categories in multiple loops
- How to wrap every 3 posts in a div (and close the last div too) [closed]
- Dividing the loop to style post differently
- WordPress PHP syntax doesn’t seem to be working correctly
- WordPress loop is not working
- How to create Loop code for Menu using WordPress?
- Problem in replacing the_content with the_excerpt()
- WordPress Custom Query: Combining Two Functions
- Search AJAX Filters – Multiple Query Loops Into One Loop (Optimization)
- Counting number of posts in multiple (sub)categories using shortcode
- Reject all malicious URL requests functions.php
- Pagination contents not changing in Front page WordPress
- array wordpress when get is null
- Like and Dislike Buttons on Post with Counter – Only allow one click per post per user session
- Display all categories including sub categories under a list ul
- Where does php code to load data go?
- Adding new divs with custom classes to products on WooCommerce shop page [closed]
- Latest posts feed with a specific post always first
- How to output values from a loop into a javascript array
- Why does a header location on admin_head remove the query var I’m setting in the location?
- Exclude category and post from loop in custom category.php
- Offset with ajax load more posts duplicates
- number of posts with “Load More”
- Get the total Author Favorited posts
- How fix error in the WordPress loop?
- what’s the syntax for if the image exists get the image?
- how to remove replicating a tag inside loop?
- My query keeps looping infinitely ! how to stop it?
- Efficient way of querying for a “fallback” post?
- Get featured image outside the loop using foreach
- Loop 1 user randomly
- Create a hierarchical loop at predefined markup requirements
- enumerating custom taxonomies?
- Two loops in one function
- How to display thumbnail if post is assigned one otherwise not
- Pagenav Not appearing on custom Template
- How to callback custom field text
- Remove the_content From Loop
- Adding if statement to content for homepage
- Tables not showing divs and loop/php items
- Pagination in category.php not functioning
- How to insert a variable into a query parameter?
- For each loop will not append to the_content hook
- WP_Query not returning results
- How to handle parent and child pages?
- How to create a loop that will display one post and stop?
- Pagination not working properly
- How do I exclude the current post from the upcoming post query