Support Forums

Looking for support? You can access the support system via your account.

Clay Tanner

Forum Replies Created

Viewing 7 posts - 1 through 7 (of 7 total)
  • Clay Tanner in reply to:
    X theme – masonry problem
    #103030

    Hey Trevor,

    I’ve been talking to theme.co support, and they provided me with the following code:

    (function ( $ ) {
      "use strict";
      $(document).on("sf:ajaxfinish", ".searchandfilter", function(){
        console.log("ajax complete");
         $('#x-isotope-loading').stop(true,true).fadeOut(300);
          $('#x-iso-container > .hentry').each(function(i) {
            $(this).delay(i * 150).animate({'opacity' : 1}, 500);
          });
        $("#x-iso-container").isotope({});
      });
    }(jQuery));

    This code finally solved my problem. I just wanted to leave it here in case anyone else looking for a solution may find it.

    Thank you guys and happy holidays!

    Clay

    Clay Tanner in reply to:
    X theme – masonry problem
    #101949

    I found this thread: https://theme.co/apex/forums/topic/ajax-plugin-load-issues-with-themex/
    Reading it makes me think they’re not very cooperative/helpful when it comes to “third party” plugins. 🙁

    However I found out that masonry view in X theme makes use of an older version of Isotope: http://isotope.metafizzy.co/

    This is how Isotope is called in index:

    <?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; ?>">

    And it is handled by _script-isotope-index.php:

    <?php
    
    // =============================================================================
    // VIEWS/GLOBAL/_SCRIPT-ISOTOPE-INDEX.PHP
    // -----------------------------------------------------------------------------
    // Isotope script call for index output.
    // =============================================================================
    
    $is_rtl = is_rtl();
    
    ?>
    
    <script>
    
      jQuery(document).ready(function($) {
    
        <?php if ( $is_rtl ) : ?>
    
          $.Isotope.prototype._positionAbs = function( x, y ) {
            return { right: x, top: y };
          };
    
        <?php endif; ?>
    
        var $container = $('#x-iso-container');
    
        $container.before('<span id="x-isotope-loading"><span>');
    
        $(window).load(function() {
          $container.isotope({
            itemSelector   : '.x-iso-container > .hentry',
            resizable      : true,
            filter         : '*',
            <?php if ( $is_rtl ) : ?>
              transformsEnabled : false,
            <?php endif; ?>
            containerStyle : {
              overflow : 'hidden',
              position : 'relative'
            }
          });
          $('#x-isotope-loading').stop(true,true).fadeOut(300);
          $('#x-iso-container > .hentry').each(function(i) {
            $(this).delay(i * 150).animate({'opacity' : 1}, 500);
          });
        });
    
        $(window).smartresize(function() {
          $container.isotope({  });
        });
    
      });
    
    </script>
    Clay Tanner in reply to:
    X theme – masonry problem
    #101751

    No, it was standard blog view, I changed it to masonry today.

    However I can’t seem to figure this out, I’m trying to use the code you provided in every possible way I can think of, but I always get JS error, like “is not a function” etc.

    Is there any way you could look take a look at it?

    Clay Tanner in reply to:
    Ajax problems
    #101513

    Oh man, that is awesome. Thank you so much Trevor!

    Clay Tanner in reply to:
    Ajax problems
    #101374
    This reply has been marked as private.
    Clay Tanner in reply to:
    Ajax problems
    #101369
    This reply has been marked as private.
    Clay Tanner in reply to:
    Ajax problems
    #101353

    Alright, I created a test website to show it in action. Looks like I was wrong, it does not seem to work for default ‘post’ type either.

    http://junkie.tk/blog -> this one uses the default post type and ajax mode, not working
    http://junkie.tk/videos -> this one uses custom post type video and uses ajax mode, not working
    http://junkie.tk/photos -> this one uses custom post type photo and doesn’t use ajax, is working

    Info:
    WP 4.7.3
    X Theme 4.6.4

    Plugins:
    Cornerstone
    CPT UI
    Search & Filter Pro
    Widget Logic

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