Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

Automatic blog page with custom design [closed]

First check your template or source code to find the classes added to the article as a whole (or any html element that wraps around the whole post. It probably looks a bit like this:

<article class="my-article">
<title class="my-title">TITLE</title>
<img src="https://wordpress.stackexchange.com/questions/228934/..." class="my-featured-image"/>
<div class="my-content">
POST TEXT
</div>
</article>

Now, in your style.css file you must distinguish between even and odd posts:

.my-article:nth-child(even) .my-featured-image (float:left;)
.my-article:nth-child(even) .my-content (float:right;)
.my-article:nth-child(odd) .my-featured-image (float:right;)
.my-article:nth-child(odd) .my-content (float:left;)

Beware that above is how you would normally switch around two items with css. This might interfere with how your theme uses its css. In stead of floats you could also use flexbox.

Related Posts:

  1. How to check if post meta key exists or not in wordpress database
  2. How to add category to: ‘wp-admin/post-new.php’?
  3. How can I retrieve multiple get_post_meta values efficiently?
  4. Code to make a post sticky
  5. How to allow hidden custom fields to be added from wp-admin/post.php?
  6. Export WordPress Posts and Meta Information in CSV format
  7. Delete duplicated wp_postmeta record
  8. Will a large postmeta table slow a site down?
  9. Update all posts automatically when using post_meta
  10. Display content from a specific category
  11. How to batch update post content with custom post meta value
  12. Change slug with custom field
  13. Better post meta efficiency?
  14. Setting post meta data to random value during post status transition / on publish
  15. Exclude category on blog list page
  16. Edit meta data does’t work with custom sql
  17. Human Time Diff, change mins to minutes
  18. Change post format using custom field
  19. Does WP get all post_meta on POST page?
  20. Sanitizing `wp_editor();` Values for Database, Edit, and Display
  21. Exporting Data from WordPress into a flat table
  22. Adding Multiple Values to a Post Meta Key
  23. Using radio button meta data from a custom meta box
  24. PHP Notice error (when on 404 page)
  25. Changing next and previous post link text
  26. What Is meta_id In wp_postmeta?
  27. Checking if a post with certain meta value exists
  28. How to permanently delete a post meta entry?
  29. Add custom field automatically (add_post_meta) with value based on number of words of article
  30. How to generate numbers indistinguishable for the IDs of the posts
  31. Modify WP_Post before processing
  32. Save re-arranged draggable post items to wordpress database
  33. I would like to give special promotion for the first 100 posts in my blog? Can anyone tell me how to do that?
  34. Change post_date to post_modified date on post template?
  35. Blog Posts not showing title
  36. Adding parent pages to posts
  37. Converting a dynamic piece of code using WordPress Loop into a static one using Post ID
  38. How can I sort posts by the date and a custom meta field?
  39. How do I get blog posts to appear within CMS?
  40. is there a way to show the the post title after the image?
  41. Get Meta Key Value While Saving Post
  42. Apply a style for 4 blogs and another style for the next 4 blogs in wordpress blog page?
  43. Force the “Choose from the most used tags” meta box section to always be expanded
  44. Meta value does not save for scheduled posts
  45. Custom Posts Query and meta_query Sort Order
  46. Private post caught in endless redirect loop
  47. How to retrieve all meta data directly from the $post object? Such as $post->related_topics?
  48. What is proper filter or hook action to add data to the $post object?
  49. Blogposting Schema & Structured Data without plugin
  50. Automatically select template based on query string for New Posts
  51. Display Updated Date Instead of Published Date
  52. How do you update post date (year only) in a separate custom field?
  53. Add postmeta to all blog posts
  54. Bulk Post update_post_meta
  55. Re-order Category Meta-data
  56. How to hide meta from search result only on pages?
  57. WP_Query sort by meta_value_num or date
  58. WordPress display page information rather than post
  59. Grab meta data before post is saved
  60. How to put the WordPress blog into theme
  61. How to fetch posts that are stored in the different table than the default table (wp_posts)?
  62. Check if user has avatar
  63. Why the blog posts is not showing?
  64. alt of attached image in post / pages
  65. Creating Ordered Query using Meta_key
  66. Best Way to detect unique posts in wp rest api
  67. Get the correct meta_value with get_post_meta
  68. post_name is not stored until post is published… where should I store my slug until it goes live then?
  69. Filter question list on substring of metavalue
  70. Add a meta to a post submited from a frontend form
  71. WP Blog Page Problems – Been stuck for a week
  72. Link post to blog from a static page
  73. Show posts between two Custom Fields date
  74. Add custom class to existing menu items from custom meta
  75. How to get only current images of a post
  76. Ordering posts alphabetically by meta keys and title
  77. Run function after post is updated
  78. Where should get_post_meta() go to get $post->ID get_post_meta() is empty and $post->ID & get_the_id() are working
  79. Posts page template: How can I edit the markup for this?
  80. Page updates appear in Preview but not live version?
  81. Adding custom fields to the Quick Edit screen – puzzled about the column concept
  82. Overwrite URL on blog posts
  83. Older entries link within a category page
  84. Show related (archive) month and year to post
  85. Multiple blog “feeds” in a single blog each with distinctly styled post pages
  86. How enter custom post meta or custom field on box post list archive page?
  87. WP_query sort by custom meta_key “price”
  88. If meta_key exists then don’t select this post?
  89. How to implement default comment section in theme template?
  90. NewsPaper WP Theme – Additional Related Posts Filter by Time (divTag composer)
  91. What effect can a large wp_post table have on overall site performance?
  92. Site ‘Categories’: save an admin global setting with post metadata [closed]
  93. How to add paraent in Blog post URL in wordpress
  94. How to make internal links creating plugin to respect ACF?
  95. Translation related post text to Arabic
  96. I have a website issue I am trying to resolve
  97. WordPress post meta key and value lookup
  98. How can I create Woodmart theme “linked variations” through REST API?
  99. Blog page shows the whole blog post instead of the excerpt or summary with the feature image only
  100. What is the best way to publish News articles?
Categories posts Tags blog-page, post-meta, posts
Get css class of menu item in custom menu structure
Delete post: 2 wp_redirect if pages are different

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress