You need to check against the value of layout
:
if ( get_theme_mod( 'layout' ) === 'stream' ) {
// Stream
} elseif ( get_theme_mod( 'layout' ) === 'grid' ) {
// Grid
} else {
// Fallback
}
Related Posts:
- Custom Loop Pagination on WordPress
- delete an array element when its date expires
- Infinite-Scroll Plugin and Jetpack Infinite Scroll Plugin – Adding to “Thoughts” Theme
- I’m trying to create an array with a foreach loop, but the array only stores the last item [closed]
- What file have I to create in my custom WordPress theme to show all the post belonging to a specific category?
- How to Fix an Archive.php That Displays All Posts?
- pagination broken – clicking next displays “page not found”
- update_user_meta as multiple value but with same meta key
- Adding new divs with custom classes to products on WooCommerce shop page [closed]
- Pagination on Custom Loop
- why is this content-template not showing any of my blog-entries?
- Woocommerce linking variations
- Cleaning up WordPress to improve performance?
- List of all theme customizer control types?
- Inject post (from specific category) between posts in Loop
- Show the most popular post per week
- Add a class to links in the visual editor (how to get old dialog back)
- Creating custom Woocommerce attribute taxonomies from a plugin
- Load post content into iframe
- wp_customize_image_control default value
- Installing wp3.2.1 on IIS; getting empty sessions
- Want to separate sections of posts. Can you restart loop?
- Specific Loop For 2 Within Each
- Two posts in same div – WP loop
- Woocommerce, recognize the loop of related products
- Overriding a theme redux file in child theme
- Widgets not showing in my custom theme
- Easiest way to show total number of subpages
- How to display custom field on homepage
- Output 2 items within the Loop
- How to get 2 or multiple custom post types in wordpress functions.php
- How can I add pagination and how can I change thumbnail size?
- Creating bulk posts with Youtube videos
- Trouble creating conditional PHP for nav menu items with children for custom Walker
- Dynamic Stylesheet loads but doesn’t finish
- Filter Select results based on selection
- How to pick the default selected value in wordpress dropdown?
- Increase offset while looping
- Customize position of social icons in upme plugin [closed]
- remove post that has no content
- Media Upload , file name changed automatically
- Replace shortcode in substring
- Get post id within comments loop
- Syntax error when I try to insert my loop into an unordered list? [closed]
- What exactly do this function declared into functions.php file of a WP theme?
- Custom Pagination is Broken
- How to overwrite orderby with add_query_var
- customize wordpress database error page
- 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)
- How to get current post category details inside “loop”?
- Ajax search shows all results when user empties input?
- List post by title length
- WP_Query multiple post results
- Convert Featured products loop into Recent products loop?
- Need help with pagination
- Posts are not looping through correctly
- Limit tags shown in post
- Create Div Wrapper On 3rd Iteration Or When Query Loop Items Run Out
- Editor capabilities – admin_init
- Add class to every other posts using get_posts
- WP insert post Redirect after function has executed
- Wp Query : Order by distance lat,lon
- How can I add diffrent editable text fields?
- How to Add a cutsom slug to my custom author role
- Give ID to divs inside the loop
- Featured image in menu wordpres
- Display articles with a different template in the home page | Solved |
- How to output the taxonomies that are assigned to each custom post?
- Having trouble creating two shortcodes, one for logged in user and one for visitors
- How can I update the price when someone enters postcode or zip code in woocommerce checkout page?
- 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
- Noob question: want to remove the “site identity” logo for specific part of website only
- WordPress Ajax filter: Create two loops for different output styles?
- How to display sticky post always at the top (before regular post) in wordpress?
- Redirect after login depending on the URL
- Return to the beginning of the results of a for loop
- How to count posts posts if they are in a separate content page?
- Thumbnail wouldn’t scale to size properly
- How to sort (orderby) a query done by a template function before the ‘foreach’ loop?
- Real time notification on user profile after new comment
- Add two or multiple functions in WordPress Post or Page
- Add div after every 4 posts then every 2 posts for a responsive loop
- Retrieving specific images from Media Library
- WordPress error on my website
- Custom Taxonomy Link Text Echo Name Not Slug
- Adding unique marketing messages between certain products whilst using isotope/Infinite Scroll
- Best way to define a database with product codes and back-end support?
- wp_customize_image_control default value
- the_post_thumbnail unless video id is added
- How to add button to top of theme customizer?
- How can I add more code to this?
- Edit the Publish Widget Options
- WordPress post pagination on custom template not working
- Implement “No related posts for this entry” into the loop?
- Options.php loop won’t show!
- New to WordPress & Freelancing [closed]
- How to get posts by a certain author in inner loop using outer loop variable or post title WordPress