Search Results for 'Masonry'

Forums › Forums › Search › Search Results for 'Masonry'

Viewing 10 results – 301 through 310 (of 354 total)
  • Author
    Search Results
  • #52579

    Trevor
    Participant

    If your theme is using something like masonry to arrange the posts, you need to manually trigger that again when the results load. Have a look through these search results:

    https://support.searchandfilter.com/forums/search/masonry/

    #50656

    Anonymous
    Inactive

    Yes, well, it’s using what avada call a grid layout, but it’s masonry by any other name.
    How would I do that?

    #50652

    Trevor
    Participant

    Is the theme using a masonry grid? If so, it looks like the masonry script isn’t be re-run.

    #50481

    Trevor
    Participant

    OK

    I can see the issue, but finding the solution will not be so easy. It is possible to use As an Archive or the Shortcode method. For you the best is as you have it (As an archive).

    So, what goes wrong? The theme you have (I find so many pre-made themes with similar issues) has a template you use, in this case blog-masonry.php

    In that, there is this code:

    <?php get_header(); ?>
    <?php get_template_part( 'title' ); ?>
    <?php get_template_part('slider'); ?>
    	<div class="qodef-container">
    		<?php do_action('kloe_qodef_after_container_open'); ?>
    		<div class="qodef-container-inner">
    			<?php kloe_qodef_get_blog('masonry'); ?>
    		</div>
    		<?php do_action('kloe_qodef_before_container_close'); ?>
    	</div>
    <?php get_footer(); ?>

    The key line is this:

    <?php kloe_qodef_get_blog('masonry'); ?>
    

    This calls a function, which I can only find if I have a copy of the theme, which is hijacking the wp_query.

    It will be necessary to find the function (hopefully it does not then further call another function), copy the function with a new name into the child theme functions.php file, make a new template by copying the one in use, but change the function call to the newly made function, and eduit that function so that the arguments for the wp_query include the S&F form results id.

    #49670

    Anonymous
    Inactive

    This is how I am pulling it in:

    in the footer:
    <script src="<?php echo get_bloginfo('template_directory');?>/library/js/masonry.pkgd.min.js"></script>

    In the custom results page:

    <script type="text/javascript">
     jQuery(window).load(function() {
    // MASSONRY Without jquery
    var container = document.querySelector('#ms-container');
     var msnry = new Masonry( container, {
    itemSelector: '.ms-item',
    columnWidth: '.ms-item',                
    });  
    });
    </script>

    I am also pulling in:
    <script type="text/javascript" src="<?php echo get_bloginfo('template_directory');?>/library/js/sf-pro-ajax-events.js" type="text/javascript"></script>
    which contains:

    //detects the start of an ajax request being made
    $(document).on("sf:ajaxstart", ".searchandfilter", function(){
      console.log("ajax start");
    });
    
    //detects when the ajax request has finished and the content has been updated
    // - add scripts that apply to your results here
    $(document).on("sf:ajaxfinish", ".searchandfilter", function(){
    	console.log("ajax complete");
    	
    	//so load your lightbox or JS scripts here again
    });
    
    //an event fired when S&F is initialised and S&F scripts have been loaded
    $(document).on("sf:init", ".searchandfilter", function(){
    	console.log("S&F JS initialised");
    });

    I can’t find anything in the console log that says anything.

    #49602

    Ross
    Keymaster

    Ok, can you share your masonry code here though as requested (Im’ assuming you’ve had to add some JS to initialise it?), just so we can get the code snippet right, and then we can work out where to put it.

    Thanks

    #49599

    Anonymous
    Inactive

    I do have masonry working perfectly without ajax, and am having problems getting the console to log when ajax is start / finished.

    #49573

    Ross
    Keymaster
    #49545

    Ross
    Keymaster

    Hey all

    Jumping on these now for anyone having problems with Masonry…

    So first thing to do is to get Masonry working when S&F is NOT using ajax – so disable ajax.

    This is the same as applying Masonry to any html elements on a page, and it is not really S&F specific anymore – so its good to get this working on your pages before we attempt anything with ajax.

    Once this is setup, can you share your masonry initialisation code here? (just the JavaScript code used for initialising Masonry / applying it to certain elements)

    Once you do that, I’m sure I can recommend the correct code snippet to perform on an ajax request.

    Thanks 🙂

    #49502

    Anonymous
    Inactive

    I am trying to do the same thing and am having trouble try to get masonry to work on ajax finish. Could you help me out?

Viewing 10 results – 301 through 310 (of 354 total)
Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.