-
AuthorPosts
-
May 7, 2024 at 12:05 pm #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 ?May 8, 2024 at 9:08 am #1442647Hey 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,
IsmaelMay 8, 2024 at 1:23 pm #1442680Hello,
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
May 9, 2024 at 10:10 am #1442798Hi,
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,
IsmaelMay 10, 2024 at 11:05 am #1442874Thank 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 regardsMay 10, 2024 at 11:07 am #1442875My internet site in progress : http://www.afortech2024.hdigital.fr/actualites/
May 10, 2024 at 5:44 pm #1442895Hi,
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,
MikeMay 15, 2024 at 4:36 pm #1443699Hi, 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 );
_____________________________________________________May 15, 2024 at 4:46 pm #1443700Hi,
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:
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,
MikeJune 4, 2024 at 8:40 am #1447698I have still trouble because I don’t know how to install the plugin … Could you help me please ? Thanks a lot !
June 4, 2024 at 11:51 am #1447798Hi,
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,
MikeJune 4, 2024 at 12:54 pm #1447861this 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-681490Edit: 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 )June 4, 2024 at 5:16 pm #1448011September 10, 2024 at 2:51 pm #1466621Hi, 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.
September 11, 2024 at 12:01 pm #1466695Hi,
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 -
AuthorPosts
- You must be logged in to reply to this topic.