Thanks Lely. It doesn’t output, but based on my stack the condition seems to be correct. This would be amazing, but I’m not sure why the code would work for someone else? Here’s the latest I’m using where I added a condition for categories. It’s so weird. Perhaps something has changed with the theme since people were using this to display an essential grid for the blog? I’m using the essential grid that came with the theme and it works perfectly wherever else I use it? Thank you in advanced for your help, I know this is a little outside scope but you guys are really great at getting users fixed up. Thank you thank you!
[code]<?php
// =============================================================================
// VIEWS/GLOBAL/_INDEX.PHP
// -----------------------------------------------------------------------------
// Includes the index output.
// =============================================================================
$stack = x_get_stack();
if ( is_home() ) :
$style = x_get_option( ‘x_blog_style’, ‘standard’ );
$cols = x_get_option( ‘x_blog_masonry_columns’, ‘2’ );
$condition = is_home() && $style == ‘masonry’;
elseif ( is_archive() ) :
$style = x_get_option( ‘x_archive_style’, ‘standard’ );
$cols = x_get_option( ‘x_archive_masonry_columns’, ‘2’ );
$condition = is_archive() && $style == ‘masonry’;
if(is_tag()) $my_posts = get_posts(array(‘tag’ => get_query_var(‘tag’)));
else if(is_author()) $my_posts = get_posts(array(‘author’ => get_query_var(‘author’)));
else if(is_date()) $my_posts = get_posts(array(‘m’ => get_query_var(‘m’)));
else $my_posts = get_posts(array(‘cat’ => get_query_var(‘cat’)));
$my_post_ids = array();
foreach($my_posts as $post) {
array_push( $my_post_ids, $post -> ID );
}
elseif ( is_category() ) :
$style = x_get_option( ‘x_category_style’, ‘standard’ );
$cols = x_get_option( ‘x_category_masonry_columns’, ‘2’ );
$condition = is_category() && $style == ‘masonry’;
if(is_tag()) $my_posts = get_posts(array(‘tag’ => get_query_var(‘tag’)));
else if(is_author()) $my_posts = get_posts(array(‘author’ => get_query_var(‘author’)));
else if(is_date()) $my_posts = get_posts(array(‘m’ => get_query_var(‘m’)));
else $my_posts = get_posts(array(‘cat’ => get_query_var(‘cat’)));
$my_post_ids = array();
foreach($my_posts as $post) {
array_push( $my_post_ids, $post -> ID );
}
elseif ( is_search() ) :
$condition = is_search() && $style == ‘masonry’;
if(is_tag()) $my_posts = get_posts(array(‘tag’ => get_query_var(‘tag’)));
else if(is_author()) $my_posts = get_posts(array(‘author’ => get_query_var(‘author’)));
else if(is_date()) $my_posts = get_posts(array(‘m’ => get_query_var(‘m’)));
else $my_posts = get_posts(array(‘cat’ => get_query_var(‘cat’)));
$my_post_ids = array();
foreach($my_posts as $post) {
array_push( $my_post_ids, $post -> ID );
}
endif;
?>
<?php if ( $condition ) : ?>
<?php echo do_shortcode('[ess_grid alias="lab-posts" posts="'.implode(',', $my_post_ids).'"]'); ?>
<?php echo ' This text will display if the condition is true else nothing'; ?>
<?php else : ?>
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php x_get_view( $stack, 'content', get_post_format() ); ?>
<?php endwhile; ?>
<?php else : ?>
<?php x_get_view( 'global', '_content-none' ); ?>
<?php endif; ?>
<?php endif; ?>
<?php pagenavi(); ?>[/code]