-
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,
Mike -
AuthorPosts
- You must be logged in to reply to this topic.