You can control this with media queries in CSS.
@media screen and (max-width: 768px) { div.row { width: 50%; } } /* for iPad */
@media screen and (max-width: 600px) { div.row { width: 100% } } /* for mobile phones */
I hope this helps.
UPDATE:
You can’t do this with PHP because PHP is executed on the server before the content is delivered to the browser, so there is no time for PHP to determine which device or viewport is in use. Have a look here.
Related Posts:
- Add div after every 4 posts then every 2 posts for a responsive loop
- Display WP posts in 3 responsive columns
- How can I fetch loop of post titles via AJAX?
- Inject post (from specific category) between posts in Loop
- Images all broken after migration and upgrade
- get product attributes for current product and store it in a variable
- Installing wp3.2.1 on IIS; getting empty sessions
- Want to separate sections of posts. Can you restart loop?
- MySQL query performed 4 times inside loop
- Specific Loop For 2 Within Each
- Two posts in same div – WP loop
- Infinite-Scroll Plugin and Jetpack Infinite Scroll Plugin – Adding to “Thoughts” Theme
- Woocommerce, recognize the loop of related products
- Easiest way to show total number of subpages
- Custom Loop through category menu to include sub categories
- Output 2 items within the Loop
- How to get to a specific position in wp_query?
- Custom excerpt function re-factoring
- How can I show the post thumbnail from the most recent of a certain post type, in widget?
- How can I add pagination and how can I change thumbnail size?
- ACF page while loop breaks footer while loop
- Split loop into two columns, how to favor one side over the other
- Dynamic Stylesheet loads but doesn’t finish
- Filter Select results based on selection
- How to hide all child pages with post_query?
- How to sort posts based on the value (number) of a post’s metadata?
- Show css depending on activity type in BuddyPress activity-loop [closed]
- How can I add extra word in permalink when someone click download button?
- Increase offset while looping
- remove post that has no content
- Checking array against author id in loop
- How do I Turn This Into An if statement?
- Widgets in the loop if active
- Get post id within comments loop
- Syntax error when I try to insert my loop into an unordered list? [closed]
- How to get post ID in a Page?
- Custom Pagination is Broken
- PHP Warning: strip_tags() expects parameter 1 to be string?
- Echo a shortcode div after every 3 posts
- How to overwrite orderby with add_query_var
- get_the_ID() in the footer returns wrong value
- Show ACF field with link to ultimate member profile/WordPress user profile below the post (single post layout)
- Where are the src and srcset sizes coming from?
- Only show first image in foreach loop
- How to get current post category details inside “loop”?
- How to pass current loop data into nested loop
- WP_Query multiple post results
- Convert Featured products loop into Recent products loop?
- Wpdb get->results to out the the month from the db
- Infinite Loop – WP_Query
- Posts are not looping through correctly
- Limit tags shown in post
- Create Div Wrapper On 3rd Iteration Or When Query Loop Items Run Out
- Php code error in wordpress if else statements [closed]
- How to create Loop code for Menu using WordPress?
- Add class to every other posts using get_posts
- Wp Query : Order by distance lat,lon
- How to Add a cutsom slug to my custom author role
- Give ID to divs inside the loop
- Display articles with a different template in the home page | Solved |
- How to output the taxonomies that are assigned to each custom post?
- Configure WordPress to Use Responsive Image Rendering
- Looping through dummy posts and showing them in the main index.php
- Custom Loop.php having a loop inside a loop
- ACF – Get ID of relationship field in flexible content
- WordPress Ajax filter: Create two loops for different output styles?
- How to display sticky post always at the top (before regular post) in wordpress?
- adding or removing endforeach; throws error!
- Return to the beginning of the results of a for loop
- How to count posts posts if they are in a separate content page?
- Adding PHP to an if else loop
- Accordion headings cuts off to second line on collapsing a accordion heading (used acf repeater)
- WordPress Recent Posts – Loop
- Thumbnail wouldn’t scale to size properly
- How to sort (orderby) a query done by a template function before the ‘foreach’ loop?
- Filter loop by ‘price’ with meta_query
- Problems with the WordPress loop [closed]
- WordPress while loop with aphabetic counting like one, two, three
- Retrieving specific images from Media Library
- Add post class in custom loop (WP_QUERY)
- Modify category archive page loop on functions.php
- Custom Taxonomy Link Text Echo Name Not Slug
- WP_Post is not from correct array
- Adding unique marketing messages between certain products whilst using isotope/Infinite Scroll
- I want my wordpress loop to only display posts of the standard format
- Automatically create a loop for post ID
- why is this content-template not showing any of my blog-entries?
- the_post_thumbnail unless video id is added
- Trying to display ads on only a third of posts in a loop. Keep getting Error 500?
- Custom single.php files for different post formats
- How to call the_author_meta and make it work?
- Troubleshooting “loopback requests that take too long”
- WordPress post pagination on custom template not working
- Implement “No related posts for this entry” into the loop?
- Excerpt all post content Content Same Size without word cutting off
- Options.php loop won’t show!
- Help with if/else loop [closed]
- Understanding responsive imagery
- orderby property of query on pre_get_posts returns incorrect value
- How do I exclude the current post from the upcoming post query