-
AuthorSearch Results
-
July 29, 2016 at 8:33 am #52579
In reply to: CSS Broken when submit form at second time
TrevorParticipantIf 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:
July 9, 2016 at 1:08 pm #50656In reply to: Empty spaces on page for non-displayed posts
AnonymousInactiveYes, well, it’s using what avada call a grid layout, but it’s masonry by any other name.
How would I do that?July 9, 2016 at 9:01 am #50652In reply to: Empty spaces on page for non-displayed posts
TrevorParticipantIs the theme using a masonry grid? If so, it looks like the masonry script isn’t be re-run.
July 7, 2016 at 5:34 pm #50481In reply to: display results on the same page
TrevorParticipantOK
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.phpIn 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.
June 28, 2016 at 5:36 pm #49670In reply to: Trying to implement with animations and masonry
AnonymousInactiveThis 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.
June 28, 2016 at 11:30 am #49602In reply to: Trying to implement with animations and masonry
RossKeymasterOk, 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
June 28, 2016 at 10:40 am #49599In reply to: Trying to implement with animations and masonry
AnonymousInactiveI do have masonry working perfectly without ajax, and am having problems getting the console to log when ajax is start / finished.
June 27, 2016 at 11:15 pm #49573In reply to: Trying to edit results.php to show results in grid
RossKeymasterJune 27, 2016 at 6:18 pm #49545In reply to: Trying to implement with animations and masonry
RossKeymasterHey 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 🙂
June 27, 2016 at 1:51 pm #49502In reply to: Trying to implement with animations and masonry
AnonymousInactiveI 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?
-
AuthorSearch Results