Tagged: x
-
AuthorPosts
-
March 1, 2017 at 4:11 pm #1390989
worldofjamesParticipantHi there
Not sure if this is doable or not! My site yorkshiresbestadventures.co.uk uses an essential grid to display posts on the homepage. I’d like all my category and tag archives to look the same, but filter out the posts depending on the category.
In other words, I’d like these types of pages
http://yorkshiresbestadventures.co.uk/activity/yorkshire/family/
to have the same look as the entries on the homepage
March 1, 2017 at 11:19 pm #1391416
RupokMemberHi there,
You can filter the posts based on category and tags. Kindly follow the Essential Grid documentation – https://www.themepunch.com/essgrid-doc/essential-grid-documentation/
Thanks!
March 2, 2017 at 2:17 am #1391544
worldofjamesParticipantHi – thanks… Yes, I know you can filter to make grids. But how do I replace the existing category/tag archive page with the new Essential Grid I create?
March 2, 2017 at 3:59 am #1391619
ChristianModeratorPlease see https://www.themepunch.com/faq/auto-populate-grid-for-blog-pages-with-the-loop-advanced/ for instructions. Also note that this since this requires theme modification, issues arising from the use of or further functionality changes would be outside the scope of our support. You might also want to learn the best practices for customizing X here https://community.theme.co/kb/customization-best-practices/
Thanks.
March 2, 2017 at 7:40 am #1391799
worldofjamesParticipantThanks Christian – great stuff.
March 2, 2017 at 7:55 am #1391816
JoaoModerator🙂
March 10, 2017 at 6:52 am #1401818
worldofjamesParticipantHi guys
Sorry to come back to this but I’ve only just plucked up the guts to try it.
According to the Essential Grid documentation, I need to alter the category.php and tag.php files to do this.
I can’t seem to locate them in the original X install to copy into my child theme and make the changes.
Can you let me know where to look for them please?
Many thanks
JamesMarch 10, 2017 at 5:36 pm #1402459
RadModeratorHi there,
You’ll have to create them, X doesn’t use them but there is no restriction that you can’t use them. You can duplicate index.php and all other files associated with it, then rename it to category.php. It’s the same, you can also try other alternatives given here https://community.theme.co/forums/topic/display-one-category-separately/
The important part is where the while() query loop is, the documentation only refer those templates since they are common and built-in to default themes such as Twentyeleven and similar. You can still use the same index.php, but you just need to include your code within is_category() block condition.
Would you mind providing the documentation you’re referring to category.php? Maybe I could provide some simply code without the need for full template customization.
Thanks!
March 11, 2017 at 12:46 am #1402781
worldofjamesParticipantCheers Rad – appreciate the help.
Here you gohttps://www.themepunch.com/faq/auto-populate-grid-for-blog-pages-with-the-loop-advanced/
March 11, 2017 at 1:54 pm #1403259
RadModeratorHi there,
Thanks, please create a file _index.php under your child theme’s folder at /x-child/framework/views/global/ and add this code
<?php // ============================================================================= // VIEWS/GLOBAL/_INDEX.PHP // ----------------------------------------------------------------------------- // Includes the index output. // ============================================================================= $stack = x_get_stack(); ?> <?php if( is_category() || is_tag() ) : $my_post_array = array(); if ( have_posts() ) { while ( have_posts() ) { the_post(); $my_post_array[] = get_the_ID(); } echo do_shortcode( '[ess_grid alias="even_grid_adams" posts='.implode(',', $my_post_array).']' ); } ?> <?php else : if ( is_home() ) : $style = x_get_option( 'x_blog_style' ); $cols = x_get_option( 'x_blog_masonry_columns' ); $condition = is_home() && $style == 'masonry'; elseif ( is_archive() ) : $style = x_get_option( 'x_archive_style' ); $cols = x_get_option( 'x_archive_masonry_columns' ); $condition = is_archive() && $style == 'masonry'; elseif ( is_search() ) : $condition = false; endif; ?> <?php if ( $condition ) : ?> <?php x_get_view( 'global', '_script', 'isotope-index' ); ?> <div id="x-iso-container" class="x-iso-container x-iso-container-posts cols-<?php echo $cols; ?>"> <?php if ( have_posts() ) : ?> <?php while ( have_posts() ) : the_post(); ?> <?php if ( $stack != 'ethos' ) : ?> <?php x_get_view( $stack, 'content', get_post_format() ); ?> <?php else : ?> <?php x_ethos_entry_cover( 'main-content' ); ?> <?php endif; ?> <?php endwhile; ?> <?php else : ?> <?php x_get_view( 'global', '_content-none' ); ?> <?php endif; ?> </div> <?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 endif; ?> <?php pagenavi(); ?>Hope this helps.
March 12, 2017 at 12:47 am #1403581
worldofjamesParticipantHi Rad
Thanks for doing that… that worked brilliantly.
You are a star
James
March 12, 2017 at 3:57 am #1403651
Rue NelModeratorHey James,
You’re welcome! We are just glad we were able to help you out.
Thanks for letting us know that it has worked for you.Cheers.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1390989 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
