Viewing 15 posts - 1 through 15 (of 15 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

    #1447698

    I have still trouble because I don’t know how to install the plugin … Could you help me please ? Thanks a lot !

    #1447798

    Hi,
    I added it for you but I don’t know what page has your magazine element, I’m pretty sure that you need to add the custom class larger-thumbnails for the script to work. Please add the custom class and check.

    Best regards,
    Mike

    #1447861

    this technique is called : infinite scroll – maybe that older post can help you on that:
    https://kriesi.at/support/topic/quick-way-to-add-infinite-scroll/#post-681490

    Edit: it still works.
    Download that little script: https://jscroll.com/#/installation
    and upload it to your child-theme js folder ( if there is none – create that child-theme subfolder )

    I load the script only for my test page (ID: 45777)
    put this to your child-theme functions.php:

    
    function my_custom_infinite_scoll() {
        if ( is_page(45777) ) {
            wp_enqueue_script( 'avia-child-jscroll', get_stylesheet_directory_uri().'/js/jscroll.min.js', array('jquery'), 2, true );
        }
    } 
    add_action('wp_enqueue_scripts', 'my_custom_infinite_scoll');

    and

    function infinite_scroll() {
    if ( is_page(45777) ) {
    ?>
    <script type="text/javascript">
    (function($) {
    $( ".content" ).jscroll({
    	loadingHtml: '<img src="/wp-content/uploads/anim-world.gif" alt="Loading" /> Loading...',
    	nextSelector: 'span.current + a',
    	contentSelector: '.article-grid',
    	autoTrigger: true,
    });
    
    })(jQuery);
    </script>
    <?php
    }
    }
    add_action('wp_footer', 'infinite_scroll', 999);

    In my case it is a blog element – give that custom class: article-grid to that element.
    Read the setting carefully ( with pagination – this nav is set to display none via css )

    see: https://webers-testseite.de/infinite-scroll/

    #1448011

    Hi,
    Thanks for sharing Guenni007

    Best regards,
    Mike

    #1466621

    Hi, could you help me please.
    I don’t understand why articles, in my Blog page, sometimes show an extract of the text below the photo, and sometimes don’t …
    I’d like to have an extract of the text always, but I don’t know how to do… and where… In the Blog page ? In the Article page ?

    Thank you in advance.

    #1466695

    Hi,

    I don’t understand why articles, in my Blog page, sometimes show an extract of the text below the photo, and sometimes don’t …

    Are you using the Advanced Layout Builder or the default editor? Please make sure you’re only using one and not both. If you used the Advanced Layout Builder, make sure that you manually specify an excerpt in the Excerpt box.

    Best regards,
    Ismael

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