-
AuthorPosts
-
May 28, 2022 at 11:46 am #1353266
Hi,
I am returning to work on my website after some time. I am currently adding blog entries and I have noticed something that did not seem to happen before. The general blog page does not seem to work regularly, as you can see here blog page
The page contains just a masonry block. In the block, in the backend, there is a notice in Italian that says that this block uses the whole screen by default and if you put it in a column (where it actually is), it will take up the available space. Plus a red warning: Regulate the content width.Also, the single articles are ok except one where I have added and accordion slider: article with Accordion slider
It shows this message either in the main part of the page or sometimes above the menu: Warning: Division by zero in /home/customer/www/elenagrassi.it/public_html/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/slideshow_accordion/slideshow_accordion.php on line 1199
and the side bar is moved downwards.
Can you help please?
Thank you. Best regards,
ElenaMay 29, 2022 at 12:31 am #1353306Hey Elena,
The Division by zero error you are getting is because you have an empty accordion slider on the page, please remove the second accordion slider or add an image to it.
I don’t understand the first issue, please include an admin login in the Private Content area so we can examine.Best regards,
MikeMay 30, 2022 at 10:50 pm #1353509Hallo Mike,
accordion slider removed and it worked, thank you-
Admin login included.
Best regards,
ElenaMay 31, 2022 at 9:43 am #1353555Hi,
Thanks for the update and login details. What exactly are you looking to achieve with the blog page? Please try to explain the problem a bit further, and what you would like to change or achieve.
Best regards,
RikardMay 31, 2022 at 4:27 pm #1353608Hi,
I would like something like the way it looked in the original demo I am using (Health Couch), which is this demo blog.
So a gallery of the blog entries, each with a photo, the title, the summary, and date.
Thank you,
ElenaJune 1, 2022 at 4:49 am #1353657Hi Elena,
We have modified your Blog page and made it two columns so it should look more like Health Coach’s blog.
In order for it to look better, you’ll need to upload a featured image with equal height and width (preferred width and height is more than 705px).
Please review your site.Best regards,
NikkoJune 1, 2022 at 12:22 pm #1353727Hi Nikko,
thanks for your help. I have uploaded a 705x705px image in the first article appearing in the blog page but it did not look better as the image was only very partially shown anyhow, due to the length of the summary text. So I have set the masonry to flexible rather than “perfect grid” so all the photos are visible. The grid is not perfect anymore but I do prefer it like that. I guess with a perfect grid only a section of the photo is shown in any case.By the way, is there a way to show only, say, a couple of lines from the summary (or the article text) and then have a “read more” link?
Best regards,
ElenaJune 2, 2022 at 4:52 am #1353842Hi Elena,
There’s a way however the read more button is not really necessary since the whole article is linked.
Here’s how you can limit the length of the summary (it includes adding read more button for visual purposes), just add this at the bottom of your child theme’s functions.php file:add_filter("avf_masonry_entry_content", function($content, $entry, $atts) { $length = 16; $more = "… <span class='avia-button avia-size-small av-masonry-read-more'>Read more</span>"; $content = wp_trim_words($content, $length, $more); return $content; }, 10, 3);
Just change the length from 16 words to other number as you see fit.
Best regards,
NikkoJune 2, 2022 at 12:38 pm #1353905Hi Nikko,
I did not have a child theme actually.
I did install one and copied that into the functions file. That worked, but the whole style of the website has been changed, as if all the style settings of the Health Couch template were cancelled. I removed the child theme, but nothing changed (although the style settings still look the same as before in the theme options general style section). How can I go back to the previous situation?Thank you,
ElenaJune 3, 2022 at 4:54 am #1353980Hi Elena,
Have you imported parent theme options?
The instructions are on this section: https://kriesi.at/documentation/enfold/child-theme/#toggle-id-4Best regards,
NikkoJune 4, 2022 at 1:29 am #1354077Hi Nikko,
no, I had not done that.
I followed all the instructions and… it worked!
Thank you very much.
If I can, I have one last question about the blog entries. They now show the image, title, beginning of the summary and date. Is it possible to show also the category name?
Best regards,
ElenaJune 5, 2022 at 3:13 pm #1354227Hi,
Perhaps try this solution.Best regards,
MikeJune 6, 2022 at 8:32 pm #1354334June 7, 2022 at 12:53 pm #1354381Hi,
Thanks for the feedback, I added this to your functions.php and it seems to be working, please check.add_filter( 'avf_masonry_loop_prepare', 'avf_masonry_loop_prepare_mod_cat', 10, 2 ); function avf_masonry_loop_prepare_mod_cat( $key, $entries ) { $categories = get_the_category($key['ID']); $separator = ' '; $output = ' <div class="ww-masonry-cat">'; if ( ! empty( $categories ) ) { foreach( $categories as $category ) { if($category->slug == "whats-new" && is_page(13)) { $output .= '<span alt="' . esc_attr( sprintf( __( 'View all posts in %s', 'textdomain' ), $category->name ) ) . '">' . esc_html( $category->name ) . '</span>' . $separator; } else { $output .= '<span alt="' . esc_attr( sprintf( __( 'View all posts in %s', 'textdomain' ), $category->name ) ) . '">' . esc_html( $category->name ) . '</span>' . $separator; } } } $output .= '</div> '; $key['text_after'] .= trim( $output, $separator ); return $key; }
Best regards,
MikeJune 7, 2022 at 3:39 pm #1354412Hi Mike,
thank you for your help.
It does show the category name, but I don’t like how it looks that much, as it is in the same font, size and color as the summary and one can hardly understand it is a category name.
Any chance it can appear in the same font and color as it appears in the article slider? (there is one at the bottom of the homepage).Best regards,
ElenaJune 8, 2022 at 4:54 am #1354470Hi Elena,
Please try adding this CSS code as well:
.ww-masonry-cat span { color: #719430; font-size: 12px; }
Best regards,
NikkoJune 10, 2022 at 6:04 pm #1354854Hi Nikko,
that makes it turn green and a smaller font size, though not the same font type as is the article slider in the homepage. I’m not sure what the font name is or why the category name link looks different in different places. It would be nice to have it look the same everywhere, for instance in each individual article page too. Is that possibile?Best regards,
ElenaJune 11, 2022 at 12:39 pm #1354903Hi,
Thank you for your patience I changed the function to this so the categories would be over the title like on your article slider in the homepage:add_filter( 'avf_masonry_loop_prepare', 'avf_masonry_loop_prepare_mod_cat', 10, 2 ); function avf_masonry_loop_prepare_mod_cat( $key, $entries ) { $categories = get_the_category($key['ID']); $separator = ' '; $output = ' <div class="custom-masonry-cat">'; if ( ! empty( $categories ) ) { foreach( $categories as $category ) { $output .= '<span alt="' . esc_attr( sprintf( __( 'View all posts in %s', 'textdomain' ), $category->name ) ) . '">' . esc_html( $category->name ) . '</span>' . $separator; } } $output .= '</div>'; $key['text_before'] .= trim( $output, $separator ); return $key; }
and added this css to match your article slider in the homepage:
.custom-masonry-cat { color: #719430; font-family: 'caveat'; font-size: 16px; text-align: center; display: block; font-weight: 700; text-transform: uppercase; }
please clear your browser cache and check.
Best regards,
MikeJune 11, 2022 at 2:50 pm #1354908June 11, 2022 at 4:40 pm #1354918Hi,
I changed the css to this:.custom-masonry-cat, .av-post-metadata-category-link a { color: #719430; font-family: 'caveat'; font-size: 16px; text-align: center; display: block; font-weight: 700; text-transform: uppercase; }
please clear your browser cache and check.
Best regards,
MikeJune 11, 2022 at 7:12 pm #1354932Hi Mike,
that looks great!
I just noticed one thing though. I have placed an article metadata block at the end of each article page, with author name, date and category name. The category name though comes written in the “caveat” font now, but in a new line with a very narrow line spacing, and centered under the first line. If possible, I would not use the Caveat font here, but if it is not possible to differentiate, I would at least make the metadata appear on a single line or, as a second choice, increase the line spacing and align it to the left.Forgive me for another question: in the main blog page, the “read more” text after the summay of each article appears in English. Can we make it in Italian like in the article slider? (In Italian that is “continua a leggere”). Also, I have just noted now that, if I hover with the mouse over “read more” it shows me a text which corresponds to the photo title (which does not necessarily correspond with the article title). Can we make the article title appear there?
Thank you for keeping up with all my requests.
Best regards,
ElenaJune 11, 2022 at 7:40 pm #1354934Hi,
I have adjusted the metadata block and the “continua a leggere” text, but the mouse-over text is from the image title because the grid element is a link, we can not change the text but we can remove it, please let us know if you want to do this and check the other elements.Best regards,
MikeJune 11, 2022 at 8:43 pm #1354938Hi Mike,
that looks perfect, thank you so much.Yes, please, let’s remove it.
That’s all, at last.Best regards,
ElenaJune 11, 2022 at 9:03 pm #1354939Hi,
Ok, I added this script to your functions.php for your blog page masonry items on mouse-over:function custom_script() { ?> <script> (function($){ $("#top.page-id-259 .av-masonry-entry,#top.page-id-259 .av-masonry-entry img").hover(function(){ $(this).removeAttr("title"); }); })(jQuery); </script> <?php } add_action('wp_footer', 'custom_script');
please clear your browser cache and check.
Best regards,
MikeJune 11, 2022 at 9:28 pm #1354944Great.
That’s all. Thank you for your helpJune 12, 2022 at 12:19 am #1354948Hi,
Glad we were able to help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.Best regards,
Mike -
AuthorPosts
- The topic ‘blog page not working regularly’ is closed to new replies.