-
Author
-
August 3, 2016 at 01:36 #131107arbolifeParticipant
Hi,
I just build a wonderful Masonry Grid using Visual Composer and put that on the Blog page, it comes with a filter by category on top.
Now throughout the site and in widgets there are list of categories. When I click on it, it creates a search result by that category using a completely different visual style. Can the grid I built be used for those category displays ?
Thanks!
August 3, 2016 at 20:19 #131252LauraModeratorHello, you will need to edit the archive.php template to match the one you created 🙂
You can do this easily using echo with the shortcodes
Check
http://php.net/manual/en/function.echo.php
https://developer.wordpress.org/reference/functions/do_shortcode/As visual composer elements are shortcodes, you can easily add it to the php using do_shortcode
For exampleCOPY CODEecho do_shortcode( '[vc_element]blah blah blah[/vc_element]' ); echo do_shortcode( '[vc_element2]bleh bleh bleh[/vc_element2]' );
In classic mode of the page editor you will see the shortcodes
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionLaura Solanes - Graphic Designer and Web Designer
Please be patient as I try to answer each topic as fast as i can.
If you like the theme or the support you've received please consider leaving us a review on Themeforest!
Always happy to help you 🙂
August 3, 2016 at 21:07 #131256arbolifeParticipantHi Laura,
Thanks for your answer, but I’m not following (probably lack some technical background).
In classic mode for my Blog page I see:
[vc_row][vc_column][vc_masonry_grid post_type="post" max_items="-1" style="lazy" items_per_page="8" show_filter="yes" gap="15" filter_style="bordered-rounded" item="8865" grid_id="vc_gid:1470176247276-98a2a59c-ab45-5" filter_source="category"][/vc_column][/vc_row]
Now I’d like to have Blog “Categories” search results use the same display with vc_masonry_grid and the grid_id I created”vc_gid:1470176247276-98a2a59c-ab45-5″.
I’m using the child theme, that probably means I have to copy archive.php from somewhere, put content in it and save it in my child theme. I’m going to ask for your help with regards to the locations of the files and the the content to put in.
Thank you,
MarcAugust 3, 2016 at 22:07 #131272LauraModeratorHello, the archive.php is in the main theme folder, copy it to child theme and edit it, you may want to delete what is on it ( not all just the template part ) and replace it with your shortcode, using do_shortcode
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionLaura Solanes - Graphic Designer and Web Designer
Please be patient as I try to answer each topic as fast as i can.
If you like the theme or the support you've received please consider leaving us a review on Themeforest!
Always happy to help you 🙂
August 3, 2016 at 22:34 #131276arbolifeParticipantOK I tried just that and it’s a complete failure. I get an HTTP error 500 in return.
Here’s my archive.php file in the kleo child theme:
COPY CODE<?php /** * The template for displaying Archive pages * * Used to display archive-type pages if nothing more specific matches a query. * For example, puts together date-based pages if no date.php file exists. * * If you'd like to further customize these archive views, you may create a * new template file for each specific one. For example, Twenty Fourteen * already has tag.php for Tag archives, category.php for Category archives, * and author.php for Author archives. * * @link http://codex.wordpress.org/Template_Hierarchy * * @package WordPress * @subpackage Kleo * @since Kleo 1.0 */ get_header(); ?> <?php //Specific class for post listing */ $blog_type = sq_option('blog_type','masonry'); $blog_type = apply_filters( 'kleo_blog_type', $blog_type ); $template_classes = $blog_type . '-listing'; if ( sq_option( 'blog_archive_meta', 1 ) == 1 ) { $template_classes .= ' with-meta'; } else { $template_classes .= ' no-meta'; } if ( $blog_type == 'standard' && sq_option('blog_standard_meta', 'left' ) == 'inline' ) { $template_classes .= ' inline-meta'; } add_filter('kleo_main_template_classes', create_function('$cls','$cls .=" posts-listing ' . $template_classes . '"; return $cls;')); ?> <?php get_template_part('page-parts/general-title-section'); ?> <?php get_template_part('page-parts/general-before-wrap'); ?> <?php if ( category_description() ) : ?> <div class="archive-description"><?php echo category_description(); ?></div> <?php endif; ?> <?php if ( have_posts() ) : ?> echo do_shortcode( '[vc_row][vc_column][vc_masonry_grid post_type="post" max_items="-1" style="lazy" items_per_page="8" show_filter="yes" gap="15" filter_style="bordered-rounded" item="8865" grid_id="vc_gid:1470176247276-98a2a59c-ab45-5" filter_source="category"][/vc_column][/vc_row]' ); else : // If no content, include the "No posts found" template. get_template_part( 'content', 'none' ); endif; ?> <?php get_template_part('page-parts/general-after-wrap'); ?> <?php get_footer(); ?>
August 4, 2016 at 21:05 #131407LauraModeratorHello, please share ftp and admin credentials and i will try to make it work 🙂
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionLaura Solanes - Graphic Designer and Web Designer
Please be patient as I try to answer each topic as fast as i can.
If you like the theme or the support you've received please consider leaving us a review on Themeforest!
Always happy to help you 🙂
August 5, 2016 at 21:51 #131514LauraModeratorHello, wordpress admin login too please :))
About the other topics, lets continue it thereHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionLaura Solanes - Graphic Designer and Web Designer
Please be patient as I try to answer each topic as fast as i can.
If you like the theme or the support you've received please consider leaving us a review on Themeforest!
Always happy to help you 🙂
August 8, 2016 at 03:11 #131591LauraModeratorHello, do you want it to populate all blog posts or do you want it to show the current selected category posts?
Because with the filter you can choose anyHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionLaura Solanes - Graphic Designer and Web Designer
Please be patient as I try to answer each topic as fast as i can.
If you like the theme or the support you've received please consider leaving us a review on Themeforest!
Always happy to help you 🙂
August 8, 2016 at 03:35 #131603arbolifeParticipantHi Laura,
Actually, let’s put this ticket on hold for now. We might leave it as it is after all.
Thanks,
MarcAugust 9, 2016 at 06:32 #131760LauraModeratorHello,ok, let me know 🙂
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionLaura Solanes - Graphic Designer and Web Designer
Please be patient as I try to answer each topic as fast as i can.
If you like the theme or the support you've received please consider leaving us a review on Themeforest!
Always happy to help you 🙂
-
AuthorPosts
The forum ‘Bugs & Issues’ is closed to new topics and replies.