<?xml version="1.0" encoding="UTF-8"?>
	<rss version="2.0"
		xmlns:content="http://purl.org/rss/1.0/modules/content/"
		xmlns:wfw="http://wellformedweb.org/CommentAPI/"
		xmlns:dc="http://purl.org/dc/elements/1.1/"
		xmlns:atom="http://www.w3.org/2005/Atom"

			>

	<channel>

		<title>Custom archive and search index page with essential grid &#8211; Themeco Community</title>
		<atom:link href="https://theme.co/archive/forums/topic/custom-archive-and-search-index-page-with-essential-grid/feed/" rel="self" type="application/rss+xml" />
		<link>https://theme.co/archive/forums/topic/custom-archive-and-search-index-page-with-essential-grid/feed/</link>
		<description></description>
		<lastBuildDate>Sun, 12 Oct 2025 01:15:22 +0000</lastBuildDate>
		<generator>https://bbpress.org/?v=2.6.14</generator>
		<language>en-US</language>

		
														
					
				<item>
					<guid>https://theme.co/archive/forums/topic/custom-archive-and-search-index-page-with-essential-grid/#post-307472</guid>
					<title><![CDATA[Custom archive and search index page with essential grid]]></title>
					<link>https://theme.co/archive/forums/topic/custom-archive-and-search-index-page-with-essential-grid/#post-307472</link>
					<pubDate>Fri, 19 Jun 2015 23:26:01 +0000</pubDate>
					<dc:creator>Joel</dc:creator>

					<description>
						<![CDATA[
						<p>Hi support:</p>
<p>Link to website: <a href="http://www.joelviruet.com/" rel="nofollow">here</a></p>
<p>I have a question which I know is outside of scope, but was hoping to get some direction, I&#8217;m so close!</p>
<p>I have set up Essential grid as my blog and archive index page. I did this by editing the global/ _index.php template in my child theme. However, whenever I input text in the search bar, no results ever show up. So I know I must have deleted something I shouldn&#8217;t have.</p>
<p>Here is the code I&#8217;m trying to include in my global/_index.php&#8230;</p>
<pre><code>&lt;?php
if(is_tag()) $my_posts = get_posts(array(&#039;tag&#039; =&gt; get_query_var(&#039;tag&#039;)));
else if(is_author()) $my_posts = get_posts(array(&#039;author&#039; =&gt; get_query_var(&#039;author&#039;)));
else if(is_date()) $my_posts = get_posts(array(&#039;m&#039; =&gt; get_query_var(&#039;m&#039;))); 
else $my_posts = get_posts(array(&#039;cat&#039; =&gt; get_query_var(&#039;cat&#039;)));
 
$my_post_ids = array();
 
foreach($my_posts as $post) {
   array_push( $my_post_ids, $post -&gt; ID );
}
 
echo do_shortcode(&#039;[ess_grid alias=&quot;blog page&quot; posts=&quot;&#039;.implode(&#039;,&#039;, $my_post_ids).&#039;&quot;]&#039;);
?&gt;</code></pre>
<p>Here is the original global/_index.php&#8230;</p>
<pre><code>&lt;?php

// =============================================================================
// VIEWS/GLOBAL/_INDEX.PHP
// -----------------------------------------------------------------------------
// Includes the index output.
// =============================================================================

$stack = x_get_stack();

if ( is_home() ) :
  $style     = x_get_option( &#039;x_blog_style&#039;, &#039;standard&#039; );
  $cols      = x_get_option( &#039;x_blog_masonry_columns&#039;, &#039;2&#039; );
  $condition = is_home() &amp;&amp; $style == &#039;masonry&#039;;
elseif ( is_archive() ) :
  $style     = x_get_option( &#039;x_archive_style&#039;, &#039;standard&#039; );
  $cols      = x_get_option( &#039;x_archive_masonry_columns&#039;, &#039;2&#039; );
  $condition = is_archive() &amp;&amp; $style == &#039;masonry&#039;;
elseif ( is_search() ) :
  $condition = false;
endif;

?&gt;

&lt;?php if ( $condition ) : ?&gt;

  &lt;?php x_get_view( &#039;global&#039;, &#039;_script&#039;, &#039;isotope-index&#039; ); ?&gt;

  &lt;div id=&quot;x-iso-container&quot; class=&quot;x-iso-container x-iso-container-posts cols-&lt;?php echo $cols; ?&gt;&quot;&gt;

    &lt;?php if ( have_posts() ) : ?&gt;
      &lt;?php while ( have_posts() ) : the_post(); ?&gt;
        &lt;?php if ( $stack != &#039;ethos&#039; ) : ?&gt;
          &lt;?php x_get_view( $stack, &#039;content&#039;, get_post_format() ); ?&gt;         
 &lt;?php x_get_view( &#039;content&#039;, &#039;search&#039; );
        &lt;?php else : ?&gt;
          &lt;?php x_ethos_entry_cover( &#039;main-content&#039; ); ?&gt;
        &lt;?php endif; ?&gt;
      &lt;?php endwhile; ?&gt;
    &lt;?php else : ?&gt;
      &lt;?php x_get_view( &#039;global&#039;, &#039;_content-none&#039; ); ?&gt;
    &lt;?php endif; ?&gt;

  &lt;/div&gt;

&lt;?php else : ?&gt;

  &lt;?php if ( have_posts() ) : ?&gt;
    &lt;?php while ( have_posts() ) : the_post(); ?&gt;
      &lt;?php x_get_view( $stack, &#039;content&#039;, get_post_format() ); ?&gt;
    &lt;?php endwhile; ?&gt;
  &lt;?php else : ?&gt;
    &lt;?php x_get_view( &#039;global&#039;, &#039;_content-none&#039; ); ?&gt;
  &lt;?php endif; ?&gt;

&lt;?php endif; ?&gt;

&lt;?php pagenavi(); ?&gt;
</code></pre>
<p>Can you give me some pointers as to what exactly I need to edit/delete in the original _index.php file?</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/custom-archive-and-search-index-page-with-essential-grid/#post-307756</guid>
					<title><![CDATA[Reply To: Custom archive and search index page with essential grid]]></title>
					<link>https://theme.co/archive/forums/topic/custom-archive-and-search-index-page-with-essential-grid/#post-307756</link>
					<pubDate>Sat, 20 Jun 2015 09:07:07 +0000</pubDate>
					<dc:creator>Rue Nel</dc:creator>

					<description>
						<![CDATA[
						<p>Hello There,</p>
<p>Thanks for writing in!</p>
<p>Your changes will not work because you have modified the index.php which is being used as the base templates of the home, index, archives, category and search. Please retain the old index.php and insert your customizations inside the conditions. For example, in line:</p>
<pre><code>elseif ( is_archive() ) :
  $style     = x_get_option( &#039;x_archive_style&#039;, &#039;standard&#039; );
  $cols      = x_get_option( &#039;x_archive_masonry_columns&#039;, &#039;2&#039; );
   
   if(is_tag()) $my_posts = get_posts(array(&#039;tag&#039; =&gt; get_query_var(&#039;tag&#039;)));
   else if(is_author()) $my_posts = get_posts(array(&#039;author&#039; =&gt; get_query_var(&#039;author&#039;)));
   else if(is_date()) $my_posts = get_posts(array(&#039;m&#039; =&gt; get_query_var(&#039;m&#039;))); 
   else $my_posts = get_posts(array(&#039;cat&#039; =&gt; get_query_var(&#039;cat&#039;)));

   $my_post_ids = array();
 
   foreach($my_posts as $post) {
     array_push( $my_post_ids, $post -&gt; ID );
   }</code></pre>
<p>And then in displaying the contents, you can replace this block of your code instead:</p>
<pre><code>&lt;?php if ( $condition ) : ?&gt;
   echo do_shortcode(&#039;[ess_grid alias=&quot;blog page&quot; posts=&quot;&#039;.implode(&#039;,&#039;, $my_post_ids).&#039;&quot;]&#039;);
&lt;?php else : ?&gt;</code></pre>
<p>Having it this way, you just simply replaced masonry with essential grid without changing the default standard setting.</p>
<p>Hope this make sense. Please let us know how it goes.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/custom-archive-and-search-index-page-with-essential-grid/#post-308169</guid>
					<title><![CDATA[Reply To: Custom archive and search index page with essential grid]]></title>
					<link>https://theme.co/archive/forums/topic/custom-archive-and-search-index-page-with-essential-grid/#post-308169</link>
					<pubDate>Sun, 21 Jun 2015 04:14:28 +0000</pubDate>
					<dc:creator>Joel</dc:creator>

					<description>
						<![CDATA[
						<p>Thanks for the help! I&#8217;m not sure if I did this totally right, but here is how I updated my index.php&#8230;</p>
<pre><code>&lt;?php

// =============================================================================
// VIEWS/GLOBAL/_INDEX.PHP
// -----------------------------------------------------------------------------
// Includes the index output.
// =============================================================================

$stack = x_get_stack();

if ( is_home() ) :
  $style     = x_get_option( &#039;x_blog_style&#039;, &#039;standard&#039; );
  $cols      = x_get_option( &#039;x_blog_masonry_columns&#039;, &#039;2&#039; );
  $condition = is_home() &amp;&amp; $style == &#039;masonry&#039;;

elseif ( is_archive() ) :
  $style     = x_get_option( &#039;x_archive_style&#039;, &#039;standard&#039; );
  $cols      = x_get_option( &#039;x_archive_masonry_columns&#039;, &#039;2&#039; );
   $condition = is_archive() &amp;&amp; $style == &#039;masonry&#039;;
if(is_tag()) $my_posts = get_posts(array(&#039;tag&#039; =&gt; get_query_var(&#039;tag&#039;)));
else if(is_author()) $my_posts = get_posts(array(&#039;author&#039; =&gt; get_query_var(&#039;author&#039;)));
else if(is_date()) $my_posts = get_posts(array(&#039;m&#039; =&gt; get_query_var(&#039;m&#039;))); 
else $my_posts = get_posts(array(&#039;cat&#039; =&gt; get_query_var(&#039;cat&#039;)));
 
$my_post_ids = array();
 
foreach($my_posts as $post) {
   array_push( $my_post_ids, $post -&gt; ID );
}
elseif ( is_search() ) :
  
if(is_tag()) $my_posts = get_posts(array(&#039;tag&#039; =&gt; get_query_var(&#039;tag&#039;)));
else if(is_author()) $my_posts = get_posts(array(&#039;author&#039; =&gt; get_query_var(&#039;author&#039;)));
else if(is_date()) $my_posts = get_posts(array(&#039;m&#039; =&gt; get_query_var(&#039;m&#039;))); 
else $my_posts = get_posts(array(&#039;cat&#039; =&gt; get_query_var(&#039;cat&#039;)));
 
$my_post_ids = array();
 
foreach($my_posts as $post) {
   array_push( $my_post_ids, $post -&gt; ID );
}

endif;

?&gt;

&lt;?php if ( $condition ) : ?&gt;
&lt;?php echo do_shortcode(&#039;[ess_grid alias=&quot;blog page&quot; posts=&quot;&#039;.implode(&#039;,&#039;, $my_post_ids).&#039;&quot;]&#039;); ?&gt;
    &lt;?php else : ?&gt;
      &lt;?php if ( have_posts() ) : ?&gt;
    &lt;?php while ( have_posts() ) : the_post(); ?&gt;
      &lt;?php x_get_view( $stack, &#039;content&#039;, get_post_format() ); ?&gt;
    &lt;?php endwhile; ?&gt;
  &lt;?php else : ?&gt;

      &lt;?php x_get_view( &#039;global&#039;, &#039;_content-none&#039; ); ?&gt;
    &lt;?php endif; ?&gt;
 &lt;?php endif; ?&gt;

&lt;?php pagenavi(); ?&gt;</code></pre>
<p>My Blog Index page and the Category Archive are pulling the Essential grids which is what I wanted. However, the search results pulls in the regular integrity blog format instead of the essential grid.</p>
<p>Do I have to change anything else?</p>
<p>Thanks for the support!</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/custom-archive-and-search-index-page-with-essential-grid/#post-308316</guid>
					<title><![CDATA[Reply To: Custom archive and search index page with essential grid]]></title>
					<link>https://theme.co/archive/forums/topic/custom-archive-and-search-index-page-with-essential-grid/#post-308316</link>
					<pubDate>Sun, 21 Jun 2015 08:58:22 +0000</pubDate>
					<dc:creator>Rue Nel</dc:creator>

					<description>
						<![CDATA[
						<p>Hello There,</p>
<p>Please add a condition if it is a search page:</p>
<pre><code>elseif ( is_search() ) :
  
   $condition = is_search() &amp;&amp; $style == &#039;masonry&#039;;

   if(is_tag()) $my_posts = get_posts(array(&#039;tag&#039; =&gt; get_query_var(&#039;tag&#039;)));
   else if(is_author()) $my_posts = get_posts(array(&#039;author&#039; =&gt; get_query_var(&#039;author&#039;)));
   else if(is_date()) $my_posts = get_posts(array(&#039;m&#039; =&gt; get_query_var(&#039;m&#039;))); 
   else $my_posts = get_posts(array(&#039;cat&#039; =&gt; get_query_var(&#039;cat&#039;)));
 
   $my_post_ids = array();
 
   foreach($my_posts as $post) {
     array_push( $my_post_ids, $post -&gt; ID );
   }

endif;</code></pre>
<p>Hopefully the search page will display using the essential grid. </p>
<p>Please let us know if this works out for you.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/custom-archive-and-search-index-page-with-essential-grid/#post-309997</guid>
					<title><![CDATA[Reply To: Custom archive and search index page with essential grid]]></title>
					<link>https://theme.co/archive/forums/topic/custom-archive-and-search-index-page-with-essential-grid/#post-309997</link>
					<pubDate>Tue, 23 Jun 2015 02:31:38 +0000</pubDate>
					<dc:creator>Joel</dc:creator>

					<description>
						<![CDATA[
						<p>I&#8217;ve included my _index.php for others who might want to implement a similar solution. Blog and archives work perfectly and the search results pulls in the queries same as with no customizations, but not the essential grids. Another thing is that the Search Results Page does not use the masonry template, which is a bit disappointing. So my solution will be to include a search bar within my Essential Grid layout.</p>
<p>If you guys have any other recommendations I&#8217;d be glad to implement and test. Thanks for the awesome support! </p>
<pre><code>&lt;?php

// =============================================================================
// VIEWS/GLOBAL/_INDEX.PHP
// -----------------------------------------------------------------------------
// Includes the index output.
// =============================================================================

$stack = x_get_stack();

if ( is_home() ) :
  $style     = x_get_option( &#039;x_blog_style&#039;, &#039;standard&#039; );
  $cols      = x_get_option( &#039;x_blog_masonry_columns&#039;, &#039;2&#039; );
  $condition = is_home() &amp;&amp; $style == &#039;masonry&#039;;

elseif ( is_archive() ) :
  $style     = x_get_option( &#039;x_archive_style&#039;, &#039;standard&#039; );
  $cols      = x_get_option( &#039;x_archive_masonry_columns&#039;, &#039;2&#039; );
   $condition = is_archive() &amp;&amp; $style == &#039;masonry&#039;;
if(is_tag()) $my_posts = get_posts(array(&#039;tag&#039; =&gt; get_query_var(&#039;tag&#039;)));
else if(is_author()) $my_posts = get_posts(array(&#039;author&#039; =&gt; get_query_var(&#039;author&#039;)));
else if(is_date()) $my_posts = get_posts(array(&#039;m&#039; =&gt; get_query_var(&#039;m&#039;))); 
else $my_posts = get_posts(array(&#039;cat&#039; =&gt; get_query_var(&#039;cat&#039;)));
 
$my_post_ids = array();
 
foreach($my_posts as $post) {
   array_push( $my_post_ids, $post -&gt; ID );
}
elseif ( is_search() ) :
  $condition = is_search() &amp;&amp; $style == &#039;masonry&#039;;

   if(is_tag()) $my_posts = get_posts(array(&#039;tag&#039; =&gt; get_query_var(&#039;tag&#039;)));
   else if(is_author()) $my_posts = get_posts(array(&#039;author&#039; =&gt; get_query_var(&#039;author&#039;)));
   else if(is_date()) $my_posts = get_posts(array(&#039;m&#039; =&gt; get_query_var(&#039;m&#039;))); 
   else $my_posts = get_posts(array(&#039;cat&#039; =&gt; get_query_var(&#039;cat&#039;)));
 
   $my_post_ids = array();
 
   foreach($my_posts as $post) {
     array_push( $my_post_ids, $post -&gt; ID );
   }

endif;

?&gt;

&lt;?php if ( $condition ) : ?&gt;
&lt;?php echo do_shortcode(&#039;[ess_grid alias=&quot;blog page&quot; posts=&quot;&#039;.implode(&#039;,&#039;, $my_post_ids).&#039;&quot;]&#039;); ?&gt;
    &lt;?php else : ?&gt;
      &lt;?php if ( have_posts() ) : ?&gt;
    &lt;?php while ( have_posts() ) : the_post(); ?&gt;
      &lt;?php x_get_view( $stack, &#039;content&#039;, get_post_format() ); ?&gt;
    &lt;?php endwhile; ?&gt;
  &lt;?php else : ?&gt;

      &lt;?php x_get_view( &#039;global&#039;, &#039;_content-none&#039; ); ?&gt;
    &lt;?php endif; ?&gt;
 &lt;?php endif; ?&gt;

&lt;?php pagenavi(); ?&gt;</code></pre>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/custom-archive-and-search-index-page-with-essential-grid/#post-310148</guid>
					<title><![CDATA[Reply To: Custom archive and search index page with essential grid]]></title>
					<link>https://theme.co/archive/forums/topic/custom-archive-and-search-index-page-with-essential-grid/#post-310148</link>
					<pubDate>Tue, 23 Jun 2015 07:17:23 +0000</pubDate>
					<dc:creator>Paul R</dc:creator>

					<description>
						<![CDATA[
						<p>Hi Joel,</p>
<p>Your code looks good.</p>
<p>Glad you were able to figure it out.</p>
<p>Thanks for sharing.</p>
<p>Have a nice day!</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/custom-archive-and-search-index-page-with-essential-grid/#post-399212</guid>
					<title><![CDATA[Reply To: Custom archive and search index page with essential grid]]></title>
					<link>https://theme.co/archive/forums/topic/custom-archive-and-search-index-page-with-essential-grid/#post-399212</link>
					<pubDate>Tue, 22 Sep 2015 21:40:54 +0000</pubDate>
					<dc:creator>Malte K</dc:creator>

					<description>
						<![CDATA[
						<p>What do i have to do, when i have custom post types? my custom post types will not show up.</p>
<p>i edit the functions.php to add my custom post types to the archive but when i want to have essential grid to show my custom post types it is not working. </p>
<p>// add custom types to archive<br />
function namespace_add_custom_types( $query ) {<br />
  if( is_category() || is_tag() &amp;&amp; empty( $query-&gt;query_vars[&#8216;suppress_filters&#8217;] ) ) {<br />
    $query-&gt;set( &#8216;post_type&#8217;, array(<br />
     &#8216;post&#8217;, &#8216;nav_menu_item&#8217;, &#8216;ausstellung&#8217;<br />
		));<br />
	  return $query;<br />
	}<br />
}<br />
add_filter( &#8216;pre_get_posts&#8217;, &#8216;namespace_add_custom_types&#8217; );</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/custom-archive-and-search-index-page-with-essential-grid/#post-399218</guid>
					<title><![CDATA[Reply To: Custom archive and search index page with essential grid]]></title>
					<link>https://theme.co/archive/forums/topic/custom-archive-and-search-index-page-with-essential-grid/#post-399218</link>
					<pubDate>Tue, 22 Sep 2015 21:47:38 +0000</pubDate>
					<dc:creator>Malte K</dc:creator>

					<description>
						<![CDATA[
						<p>ah that was easy i just changed every where &#8220;get_posts&#8221; to ==&gt; &#8220;query_posts&#8221; thats it. and now my custom posts are displaying too.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/custom-archive-and-search-index-page-with-essential-grid/#post-399382</guid>
					<title><![CDATA[Reply To: Custom archive and search index page with essential grid]]></title>
					<link>https://theme.co/archive/forums/topic/custom-archive-and-search-index-page-with-essential-grid/#post-399382</link>
					<pubDate>Wed, 23 Sep 2015 02:53:55 +0000</pubDate>
					<dc:creator>Prasant Rai</dc:creator>

					<description>
						<![CDATA[
						<p>You are most welcome 🙂 .</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/custom-archive-and-search-index-page-with-essential-grid/#post-399791</guid>
					<title><![CDATA[Reply To: Custom archive and search index page with essential grid]]></title>
					<link>https://theme.co/archive/forums/topic/custom-archive-and-search-index-page-with-essential-grid/#post-399791</link>
					<pubDate>Wed, 23 Sep 2015 11:29:41 +0000</pubDate>
					<dc:creator>Malte K</dc:creator>

					<description>
						<![CDATA[
						<p>ah but the search ist not working with custom post types, what do i have to change?</p>
						]]>
					</description>

					
					
				</item>

					
		
	</channel>
	</rss>

