You still can use lists – just use proper CSS (every third li – first li in every row – should have clear
property set; You can use CSS classes or :nth-child selector to do this).
If you really have to use table (I don’t suggest it – it’s not a very good idea, because it’s not semantic), you can do something like this:
<table>
<?php while ( have_post() ): the_post(); ?>
<php if ( $wp_query->current_post % 3 == 0 ): ?>
<?php if ( $wp_query->current_post ): ?>
</tr>
<?php endif; ?>
<tr>
<?php endif; ?>
<td>
... YOUR POST GOES HERE
</td>
<?php endwhile; ?>
<?php $i = $wp_query->current_post; while ( $i % 3 != 0 ): $i++ ?><td></td><?php endwhile; ?>
</tr>
</table>
Not tested it, so it can be a little bit buggy, but idea should be clear.
Related Posts:
- What is the use of to_ping and pinged column?
- Removing filter dropdown in posts table (in this case Yoast SEO)
- How do you display posts in a dynamic table?
- Custom fields on a virtual page
- problems with loading posts in a table-row
- Why Query is returning empty array?
- HTML Form Submit to table in same page
- Shortcode for tables which can include comma and linebreaks
- How to fetch posts that are stored in the different table than the default table (wp_posts)?
- Query post by meta key of another table
- GET the excerpt by ID
- The next_posts_link() works only with original $wp_query
- How can you change the ‘Insert into Post’ title in the media button?
- $post->ID and the_id() always return the wrong value
- Callback for wp.autosave.server.triggerSave();
- Disallow Same Post Title
- Adding a div class or id inside the_content()
- Delete Child Posts
- In what sequence are the hooks fired when a post is “published”?
- Number of posts per page setting is not working?
- Pagination for Pages and Posts
- How to choose a sort order (for posts) per category? (ideally when creating a new category)
- Load post content into div with ajax
- Why does `url_to_postid` return 0 when testing `page_for_posts` Page?
- How to lock a post or page
- orderby=meta_value_num creates duplicate posts
- Including new Javascript only after a comment is made
- Query posts from different categories in multisite
- add filter to “quick edit menu” in wordpress admin
- How to bring an old edited/modified post in the front of page?
- Display all months with posts and inside each month show the 5 latest posts
- Is there a way to backdate posts?
- How to make search for the custom post type?
- WordPress post tag & custom field
- posts_nav_link() not displaying anything
- Visual / HTML tabs vanished on editor
- Why won’t my taxonomy query show up?
- URL Rewriting if it is a single post / redirecting post – post type
- Multisite – Get current post id
- how to remove dash (-) post status from post title on posts listing page wordpress
- How to show single post page as home page
- Why WP_Query(‘showposts=5’) shows only 1 post?
- Errors when uploading images in WP 3.5
- Get more than one author’s posts with REST API
- More then one menu items are assigned with “current-menu-item” class
- How can i delay reading posing in 3days for not logined user?
- how to change the number of posts returned in a specific loop without making it global?
- Related posts by category not working right
- custom post template file not shown, instead all the time 404.php
- How to Mysql select a list of posts with meta_values AND all relevant categories?
- Nested WP_Query breaking loop
- 2 dynamic sidebars registered, not showing up
- How to create wordpress class with post meta? [closed]
- Custom taxonomy archive page problem
- post__in not working with pre_get_posts, but post__not_in does work
- All posts display default index.html
- Blog page error ‘Index of /blog’
- Disable posts generated from image uploads
- tribe_get_start_time displays the current date and time on other post types than tribe_events
- How to get the latest URL of my blog?
- Not all posts showing in query
- Template for regular posts (no custom post types)
- When using Tribe Events Calendar, querying for a specific event category returns nothing
- If post exists, make it a comment in existing post with same name?
- Use Post as Front Page
- Possible?! A contextually titled back link
- Post navigation using date
- Error while excluding a post from another loop (using its ID)
- definining own teaser text for post
- I need to create “View Profile” and “Edit Profile” links by incorporating the Post Title/ID, but can’t seem to manage it
- How to remove special characters in post title
- Search results with pagination not working
- How to retrieve all meta data directly from the $post object? Such as $post->related_topics?
- Exclude posts in a category on one page but show those posts on a different page
- custom post single page
- show loop id post , only first id can read
- Loading posts outside wordpress
- Difference between modified post and new post
- Disable archiving of old posts?
- Customizing individual images on posts
- Allowing Users to Delete Their Posts
- How to add a class to links inside posts text
- Query post category & remove any post id
- Converting Posts to Pages
- No comments on static front page
- Latest comment post should be the first post in the blog
- Run Jquery Script after delete post in front end
- How to limit the number of results for all query_posts on mysite
- how to show posts on different pages if number of post per page is one
- The next_posts_link() works only with original $wp_query
- Latest news mini images
- User driven content problems
- Admin moderates ALL comments (including post author)
- Load posts from external source if not found in database
- jquery: getting contents of #content field on post page
- How to show total view count across all posts for an author
- How can we pass a value from the_permalink() at WordPress?
- Post dynamic fields and style
- How to redirect image attachment to its original post
- How can I make my blog private? [closed]