This topic has 11 replies, 2 voices, and was last updated 8 years by Laura.

  • Author
  • #131107
     arbolife
    Participant

    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!

    #131252
     Laura
    Moderator

    Hello, 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 example

    COPY CODE
    
    echo 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 solution

    Laura 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 🙂

    #131256
     arbolife
    Participant

    Hi 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,
    Marc

    #131272
     Laura
    Moderator

    Hello, 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 solution

    Laura 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 🙂

    #131276
     arbolife
    Participant

    OK 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(); ?>
    
    #131407
     Laura
    Moderator

    Hello, 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 solution

    Laura 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 🙂

    #131414
     arbolife
    Participant
    This reply has been set as private.
    #131514
     Laura
    Moderator

    Hello, wordpress admin login too please :))
    About the other topics, lets continue it there

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura 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 🙂

    #131525
     arbolife
    Participant
    This reply has been set as private.
    #131591
     Laura
    Moderator

    Hello, 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 any

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura 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 🙂

    #131603
     arbolife
    Participant

    Hi Laura,

    Actually, let’s put this ticket on hold for now. We might leave it as it is after all.

    Thanks,
    Marc

    #131760
     Laura
    Moderator

    Hello,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 solution

    Laura 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 🙂

Viewing 12 posts - 1 through 12 (of 12 total)

The forum ‘Bugs & Issues’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?