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
- fetch from an external api call and display results in page
- Get author full name
- Integrating WordPress to my website, while keeping my own authentication system
- Remove/unset options field from backend Settings->General?
- How to loop over custom fields in a page template?
- WordPress Customizer: How can you have multiple active callbacks on one control?
- Edit postmeta when user changes user role?
- How to add default images into theme customizer image control?
- Store loop into array
- Looping through WP_Post Object
- WordPress Ajax Data problem
- Remove all nav menu classes ( but keep useful ones… )
- Add attribute / custom attribute to product in woocommerce
- Show Custom Taxonomy Title
- How to exclude specific category from the get_the_category(); array
- spliting posts into two columns
- Displaying theme options in css
- How to Display a Single Post Excerpt
- $wpdb->flush(); breaks the loop
- Hide wordpress field if data is empty in post!
- Only show search results with if current date is between two dates?
- database interactions using OOP
- Extending the WP_Widget_Text class
- Trying to build simple deposit code that hooks into woocommerce
- Iterate through posts based on array of categories
- user_profile_update_errors hook not executing
- Saving and Restoring a Canvas on A Individual User Basis
- Extend plugin Class through functions.php
- How to add condition in wordpress loop? [closed]
- Weird 404 URL Problem – domain name being placed at end of urls
- Alert Bar section within WP loop is displaying even though there are no posts
- Output custom field value to post string
- Compare the old get_theme_mod($name) to the new get_theme_mod($name) return value
- Load wordpress content in other domain
- how to show only specific category for a template
- Changing the_posts_navigation() html output
- How to get private property in parent class into extended class?
- WP_Query fails despite having 1 post
- Loop stopped working
- How to loop through all the attached images in a post, and get their url one by one
- Store post content in a php variable and output them using for loop
- Clickable image link sends people to wrong URL
- Show recent posts starting at a specific number archive
- How to get the last category name of a child category?
- WordPress query undefined offset in loop
- Issue with custom loop in Archive page
- How to include custom PHP file both in header and footer files
- WP Query Leads to 502 Bad Gateway (Timeout Because Query Takes Too Long)
- home.php show blog posts as grid view
- get_theme_mod outputs number when using WP_Customize_Cropped_Image_Control
- Reusable code that I can store in the function.php and apply to other templates as need. Dry Code
- WordPress call post-ID in jquery
- How to extract information from a wp_query result?
- List all anchor links on a page
- Assign Custom classes to every Excerpt
- Make next post button link to random post
- Site DOES NOT LOAD after 3.1 update
- Customizer control save then return to default
- Responsive loop with 3 columns inside row then 2 columns
- Delete post meta by serialized meta value
- Dynamic Banner Text based on Subdomain
- Redirecting the lost password page request when using a custon login page
- Remove specific javascript when viewing page in Customizer?
- Running local copy of an old WordPress site on MAMP
- Date of last blog update for specific authors only?
- PHP for loop not working as intended
- Customizing WooCommerce with PHP
- What image is this pulling?
- For each 3 posts, show a different post type
- How to use PHP code with wordpress page
- WP Knowledge Base Theme bug – Subcategories and Articles, Need to change WP_Query
- if is_bbPress register jquery
- Auto create description in post
- Inserting A Feed and Sidebar into an HTML Page
- What is the best way to get the first few post from WordPress in different divs using a loop?
- Advanced Taxonomy query, with 3 post types
- error with WP custom form
- How can I clear the theme mod settings?
- Custom PHP-coding in MU installs
- Why does a meta_query break this WP_Query?
- Date when the custom field was added
- Loop on a wordpress Page instead of content coming from the WP text editor
- How to create a loop where loop changes every post?
- $_html is empty when var dumped
- WP Custom tables query
- I want to show image from custom field image on my custom page template
- Count the number of matching post names in foreach loop
- Woocomerce custom add to cart button edit functionality [closed]