Tagged: 

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #1343673

    I have a custom category.php where I change the display to Masonry using this:

    $masonry  = new avia_masonry( $atts );
    $masonry->extract_terms();
    $masonry->query_entries();
    $masonry_html = $masonry->html();
    echo "<div class='entry-content-wrapper'>".$masonry_html."</div>";
    

    It looks like 4.9 has changed the way Masonry is called. I get some errors related to the $atts. Can someone let me know the best way to call masonry now with the new method?

    • This topic was modified 2 years, 1 month ago by christiemade.
    #1343757

    Hey Christie,

    Thank you for the inquiry.

    What was the exact error in your installation? Please post the error here so that we can understand the issue better.

    Best regards,
    Ismael

    #1343865

    Here is the error: PHP Fatal error: Uncaught Error: Call to a member function get_default_sc_args() on null in /nas/content/live/dembostage/wp-content/themes/enfold/config-templatebuilder/avia-template-builder/php/base-classes/class-sub-item-query-base.php:84\nStack trace:\n#0 /nas/content/live/dembostage/wp-content/themes/enfold/config-templatebuilder/avia-shortcode-helpers/class-avia-masonry.php

    Also, the contents for $atts, if needed:

    $atts = array(
      'type'			=> 'grid',
      'items'			=> get_option('posts_per_page'),
      'columns'		=> 3,
      'class'			=> 'avia-builder-el-no-sibling',
      'paginate'		=> 'yes',
      'use_main_query_pagination' => 'yes',
      'custom_query'	=> array(
             'post__in'	=> $post_ids,
             'post_type'	=> get_post_types()
      )
    );
    • This reply was modified 2 years, 1 month ago by christiemade.
    #1344081

    Hi christiemade,

    Can you post the whole code of your archive.php file in https://pastebin.com/ and give the link to us? so we can try to test your code on our end.
    You can post the link in private content.

    Best regards,
    Nikko

    #1344245

    Here you go!

    #1344441

    Hi christiemade,

    Thanks, we have reported this issue to our devs.
    For the meantime please use avia_post_slider or fallback to the previous version of Enfold(4.8) as a temporary solution.
    We’ll post here once a solution is made available.

    Best regards,
    Nikko

    • This reply was modified 2 years, 1 month ago by Nikko.
    #1344459

    Hi christiemade,

    Can you test this version (private content) and see if it works properly on your end?
    Just upload the zip file in Appearance > Themes and it should replace the current version of Enfold.
    Once replaced, please change this code on your category.php file:

    $masonry  = new avia_masonry( $atts );
    $masonry->extract_terms();
    $masonry->query_entries();
    $masonry_html = $masonry->html();

    with:

    $masonry  = new avia_masonry( $atts );
    $masonry->extract_terms();
    $masonry->query_entries();
    $masonry->get_element_styles();
    $masonry_html = $masonry->html();

    Regards,
    Nikko

    #1344645

    This fixes that error, yes, thank you!!
    I had several other customizations in place inside the av-helper-masonry.php file. Enfold has moved all that functionality over to class-avia-masonry.php – which I cannot figure out how to override in the child theme. Any tips?

    #1344672

    Hi christiemade,

    We’re glad that we could help :)
    What are those customizations?
    As for overriding avia_masonry, you should be able to do it easily by creating a class with the name of avia_masonry in your child theme.
    You can just copy the whole class and paste it in functions.php file (though I suggest you use a separate file and then include it) then make tweaks to it.

    class avia_masonry extends \aviaBuilder\base\aviaSubItemQueryBase
    {
      // all the code inside
    }

    I hope this helps.

    Best regards,
    Nikko

    #1344751

    Thank you – it’s a lot of small things, but it’s all over that file (things not provided by any hooks or filters).
    I’ve tried putting the class definition in my child theme and this is the error I get:
    PHP Fatal error: Uncaught Error: Class "aviaBuilder\\base\\aviaSubItemQueryBase" not found in /nas/content/live/dembostage/wp-content/themes/dembo/custom/class-avia-masonry.php:5\nStack trace:\n#0 /nas/content/live/dembostage/wp-content/themes/dembo/functions.php(6): include()\n#1 /nas/content/live/dembostage/wp-settings.php(555): include('/nas/content/li...')\n#2 /nas/content/live/dembostage/wp-config.php(128): require_once('/nas/content/li...')\n#3 /nas/content/live/dembostage/wp-load.php(50): require_once('/nas/content/li...')\n#4 /nas/content/live/dembostage/wp-blog-header.php(13): require_once('/nas/content/li...')\n#5 /nas/content/live/dembostage/index.php(17): require('/nas/content/li...')\n#6 {main}\n thrown in /nas/content/live/dembostage/wp-content/themes/dembo/custom/class-avia-masonry.php on line 5

    • This reply was modified 2 years, 1 month ago by christiemade.
    #1344756

    Hi christiemade,

    Can you setup a staging site for us? so we can try to inspect further without affecting your live site.

    Best regards,
    Nikko

    #1344761

    I am working on a staging site already, of course! The site won’t even load though with the class override. (As you can see)

    #1344771

    Hey!

    Please check enfold\config-templatebuilder\avia-template-builder\php\class-template-builder.php

    around line 686 you have the function autoloadLibraries()

    and inside filter avf_load_single_shortcode_file.

    There you can hook to load your customized file instead the original one.

    A few lines above you have filter avf_load_single_builder_core_file where you can load modified customized core files.

    Regards,
    Günter

    #1344814

    Oh, wonderful! This is exactly what I need. Thank you so much as always for your help! I’ve got it from here!

    #1344815

    Hi christiemade,

    We’re glad that we could help you :)
    Thanks for using Enfold and have a great day!

    Best regards,
    Nikko

Viewing 15 posts - 1 through 15 (of 15 total)
  • The topic ‘Manual Masonry Call in Enfold 4.9’ is closed to new replies.