Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1442547

    Hello,
    I am wondering how to get a blog format with a “foldable / unfoldable” option ?
    I’d like to have a format of my articles like in this site : https://afortech.com/news/
    Could you help me please ?

    #1442647

    Hey Hippotigris,

    Thank you for the inquiry.

    The site above isn’t fully loading on our end, but based by how the articles are displayed, you can use the Magazine element. It closely resembles the blog format you’re looking for.

    Best regards,
    Ismael

    #1442680

    Hello,

    ok and thank you. The only problem with the “magazone element” is that I don’t know how to show not only the title and the image, but also the 4/5 first lines of the article, before the “read more” … Any idea ? Thank you

    #1442798

    Hi,

    Thank you for the update.

    You can use the avf_magazine_excerpt_length filter in the functions.php file to adjust the length of the excerpt of the magazine entries.

    add_filter('avf_magazine_excerpt_length','avf_magazine_excerpt_length_mod', 10, 1);
    function avf_magazine_excerpt_length_mod($excerpt) {
        $excerpt = 100;
        return $excerpt;
    }
    

    Best regards,
    Ismael

    #1442874

    Thank you !
    And last question, sorry : how can I modify the size of the thumbnail size of the magazine element, when I use the above configuration ?
    THanks in advance, best regards

    #1442875

    My internet site in progress : http://www.afortech2024.hdigital.fr/actualites/

    #1442895

    Hi,
    Try adding the custom class larger-thumbnails to the magazine element that you are using on the page and then add this code to the end of your child theme functions.php file in Appearance ▸ Editor:

    function custom_larger_thumbnails_script() { ?>
      <script>
    (function($){
      $('.av-magazine.larger-thumbnails .av-magazine-entry img').attr('width', '180px');
      $('.av-magazine.larger-thumbnails .av-magazine-entry img').attr('height', '180px');
      $('.av-magazine.larger-thumbnails .av-magazine-entry img').attr('sizes', '(max-width: 180px) 100vw, 180px');
      $('.av-magazine.larger-thumbnails .av-magazine-entry .av-magazine-thumbnail').css({'height': '180px','width': '180px'});
    })(jQuery);
    </script>
      <?php
    }
    add_action( 'wp_footer', 'custom_larger_thumbnails_script', 99 );

    Please ensure to copy the code from the forum and not an email notification so the symbols are not converted.

    Best regards,
    Mike

    #1443699

    Hi, sorry but I am not a developer, and I am not sure where I should add these 2 pieces of code …
    I have added them in the functions.php file (see below), but it seems that there is an error … Could you help me please ?

    The error message says : syntax error, unexpected ‘add_filter’ (T_STRING) … ?
    Thank you !

    _________________________________________________
    add_filter(‘avf_magazine_excerpt_length’,’avf_magazine_excerpt_length_mod’, 10, 1);
    function avf_magazine_excerpt_length_mod($excerpt) {
    $excerpt = 100;
    return $excerpt;
    }

    __________________________________________________
    function custom_larger_thumbnails_script() { ?>
    <script>
    (function($){
    $(‘.av-magazine.larger-thumbnails .av-magazine-entry img’).attr(‘width’, ‘180px’);
    $(‘.av-magazine.larger-thumbnails .av-magazine-entry img’).attr(‘height’, ‘180px’);
    $(‘.av-magazine.larger-thumbnails .av-magazine-entry img’).attr(‘sizes’, ‘(max-width: 180px) 100vw, 180px’);
    $(‘.av-magazine.larger-thumbnails .av-magazine-entry .av-magazine-thumbnail’).css({‘height’: ‘180px’,’width’: ‘180px’});
    })(jQuery);
    </script>
    <?php
    }
    add_action( ‘wp_footer’, ‘custom_larger_thumbnails_script’, 99 );
    _____________________________________________________

    #1443700

    Hi,
    The error that you see from adding the code to your functions.php file is typical for copying the code from a email notification from this thread, please ensure to copy the code from the forum and not an email notification so the symbols are not converted.
    It looks like you are not using a child theme, so in this case you could use the WP Code plugin then add a new snippet, in the top right corner use the PHP snippet as the code type:
    Enfold_Support_2680.jpeg
    then add this code and save.

    function custom_larger_thumbnails_script() { ?>
      <script>
    (function($){
      $('.av-magazine.larger-thumbnails .av-magazine-entry img').attr('width', '180px');
      $('.av-magazine.larger-thumbnails .av-magazine-entry img').attr('height', '180px');
      $('.av-magazine.larger-thumbnails .av-magazine-entry img').attr('sizes', '(max-width: 180px) 100vw, 180px');
      $('.av-magazine.larger-thumbnails .av-magazine-entry .av-magazine-thumbnail').css({'height': '180px','width': '180px'});
    })(jQuery);
    </script>
      <?php
    }
    add_action( 'wp_footer', 'custom_larger_thumbnails_script', 99 );

    If you still have trouble after you install the plugin, include a admin login in the Private Content area so we can assist.

    Best regards,
    Mike

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.