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
- Blog posts repeat
- Long running queries
- wpdb php get_var query to get ID for URL image doesn’t work for ID over 999
- How to add condition in wordpress loop? [closed]
- Woocommerce : Can’t get product info in loop
- How to set variable, pass it to a partial file and remove it after?
- how to refresh div on template part?
- How to pre populate a form field with a link of a current user’s author profile?
- Two queries for a WP_User_Query search work perfectly apart, but not together
- Trying to get a PHP variable defined in a custom post into a javascript file. Null value. Using wp_localize_script
- Alert Bar section within WP loop is displaying even though there are no posts
- remove post that has no content
- Display category name only once inside loop
- Can’t find infinite loop cause
- Checking array against author id in loop
- How do I Turn This Into An if statement?
- Query if audio attachment AND/OR custom field
- Using $wpdb (WPDB class) ‘replace’ with multiple WHERE criteria problem
- Load wordpress content in other domain
- How Can I use WP_Query to Only Display 1 Post from Custom Post Type if Query Returns Posts with Matching ID in Custom Field
- Checkbox doesn’t stay checked, conten
- register_taxonomy() take much queries
- WordPress SQL injection
- Which is the correct way to conditionally enqueue a CSS file?
- post thumbnail, conditions, else wont work
- Widgets in the loop if active
- List posts that don’t have a specific tag?
- Changing the_posts_navigation() html output
- Can we count the WordPress Loop
- Odd / Even posts add class minus first post
- Get post id within comments loop
- Syntax error when I try to insert my loop into an unordered list? [closed]
- WP_Query fails despite having 1 post
- unable to use ‘new WP_Query’ in AJAX call
- Add content after the first post in WP Loop
- wp_query get the 2nd post
- Loop stopped working
- How to get post ID in a Page?
- Parse error: syntax error, unexpected ‘}’ on get_the_author_meta [closed]
- Custom Pagination is Broken
- Display an image if odd number of posts in grid
- How to loop through all the attached images in a post, and get their url one by one
- I’m trying to create an array with a foreach loop, but the array only stores the last item [closed]
- How to list commenters and days since last commented
- PHP Warning: strip_tags() expects parameter 1 to be string?
- Store post content in a php variable and output them using for loop
- Echo a shortcode div after every 3 posts
- How to avoid duplicates when creating recent network posts
- Can’t update multiple rows with $wpdb query
- What file have I to create in my custom WordPress theme to show all the post belonging to a specific category?
- Why in my theme I can’t see all the statics content under the posts?
- 2nd page displaying the exact same posts as my first page (minus the very first post)
- Is the 404 page automatically displayed if a loop returns nothing?
- How do I remove a category from a wordpress loop>
- How can i count the post added in relationship field, theme display
- variable value disappears in a second loop
- Last class on last headline?
- working with term_relationships table
- Show recent posts starting at a specific number archive
- get_the_ID() in the footer returns wrong value
- How to get the last category name of a child category?
- Show ACF field with link to ultimate member profile/WordPress user profile below the post (single post layout)
- Can I make get_users() query global?
- How to pass a variable to get_template_part that’s updated every time the template part is called?
- How to unlink all posts from tracking same amount of views
- In WordPress, how do I get the number of posts next to single_cat_title(”); in the category.php file?
- How to display SQL query that ran in WC_Order_Query?
- Custom Post type slider with thumbnail navigation
- Why my loop isn’t working? [closed]
- WordPress loop by meta key that is an array? and how loop multiple arrays
- Only show first image in foreach loop
- use loop to return blog details
- How can I count ACF sub_field with a certain value
- Parse error: syntax error, unexpected ‘}’ [closed]
- How to get current post category details inside “loop”?
- Shortcode to pull posts
- How to pass current loop data into nested loop
- Get all posts as an array ID => Name
- PHP -> SQL Query with Summing
- How to hide posts of a specific custom category in WordPress?
- How to get post ID from button and pass title to Modal
- WP Query Leads to 502 Bad Gateway (Timeout Because Query Takes Too Long)
- home.php show blog posts as grid view
- Problem with custom loop and wp_list_pluck [closed]