-
AuthorPosts
-
January 30, 2021 at 9:15 pm #1276543
Hi,
i use a masonry to show my blog posts.
i need to put a “read more” button under every element.
What code do i have to put in my functions.php??
(make sure that the “read more” does not show up in the masonry gallery – i am talking about a masonry to show my blogposts!)Christian
February 1, 2021 at 4:11 am #1276664Hey DouPaule,
This is actually something that would require a custom solution and the help of a freelancer. It goes beyond the scope of support here in the forums.
Best regards,
Jordan ShannonFebruary 5, 2021 at 5:00 pm #1278079Oh really??
But others got this help from you.
Maybe you want to search the forum to find which people got that “customization” while i write a one star rating on Themeforest
DEAL?February 6, 2021 at 6:29 pm #1278330Hi DouPaule,
Could you please give us a link to your website, we need more context to be able to help you.
Best regards,
VictoriaFebruary 7, 2021 at 6:52 pm #1278460i ask a general question and you need context????
What a pitty that i cant give zero stars on Themeforest….February 14, 2021 at 1:17 am #1280342Hi,
Sorry for the very late reply, to add a “read more” link to your masonry elements you can use this script./* Add a "read more" link" to masonry elements */ function ava_custom_script_mod(){ ?> <script> (function($){ $(window).on('av-height-change', function() { $('.av-masonry-entry').each(function() { var more = $(this).find('.av-masonry-read-more'); var cont = $(this).find('.av-masonry-entry-content'); if( more.length == 1 ) return; cont.append('<div class="av-masonry-read-more">Read more</div>'); }); }); })(jQuery); </script> <?php } add_action('wp_footer', 'ava_custom_script_mod');
This doesn’t effect the masonry gallery element because it doesn’t include the av-masonry-entry-content class.
Best regards,
MikeFebruary 16, 2021 at 4:08 pm #1281384Hello Mike,
thank you.I can see by the result and by the already existing class “av-masonry-read-more” that at least it was planned to implement that as a feature, right?
There are questions regarding that:
1: Why isnt it?
2: Why do your collegues (at least Jordan) treat a question like that like something Enfold customers should pay for?Issue:
The button makes the blogentries overlap with the entries from the next row.
I tried to find the class that defines the bottom-margin from the masonry blogentries, but i couldnt.
What is the approprieta class to fix that?Christian
February 17, 2021 at 3:50 pm #1281763Hi,
Glad to hear that helped, I don’t find any reference to “read more” being added to masonry items, and as I’m sure you have noted, the masonry element only offers:
Display Title and Excerpt
Display Title
Display Excerpt
Display NeitherSo we could continue with the above solution, or I can submit a feature request to add “Read More” to the masonry element.
If you would like to continue with the above solution, then it would help me if you would post a link to your test page, adjusting padding and margin should be easy to do, but not by removing a class, by adding css.
I see above you don’t seem to want to post your link, but there are many theme settings that change the layout even in the same demo, so while I can adjust this on my localhost, typically this doesn’t always translate exactly to the customer’s (your) site.
I hope that makes sense.Best regards,
MikeFebruary 18, 2021 at 1:38 pm #1281988Hi,
i work on localhost, so there is no way to show you, except you come along for a coffee.Can you at least tell me what the class/Id is which increases/decreases the margin of the isotope/masonry entry elements??
Whatever i try to grab with my inspector ….i cant get the appropriete element.
It has:
Always Display Title and Excerpt on the bottom of the element“a feature request to add “Read More” to the masonry element” cant be so wrong.
Here are users which have had a support in this case:
https://www.google.com/search?client=firefox-b-d&q=site%3Akriesi.at+read+more+masonryFebruary 19, 2021 at 1:07 pm #1282202Hi,
Ok, I tested the masonry element in the Enfold 2017 Demo, and used the script above and the “read more” link shows in theav-masonry-entry-content entry-content
div above theav-masonry-date
div:
and so there is no overlap.
Theav-masonry-entry isotope-item
div is the actual masonry item div and it has no margin or padding.
It sounds like you have other custom css that is displacing the inner elements, try removing your custom css and see if it looks similar to my screenshot above.
Another option would be for you to create another local instance using the 2017 Demo, to achieve the result above, and then you can test and examine the difference between your two sites and how to implement this on your site.
Please note, that I do not mean for you to import the 2017 Demo into your current working localhost site, this would overwrite your site, you would need to create a new WP localhost site.Best regards,
MikeFebruary 21, 2021 at 3:24 pm #1282606ISSUE
Your code also produces a button in the masonry gallery and this is exactly what i mentioned not to want in my first, initial post in this thread.
Here is the task again:
– Button in masonry portfolio for blogposts
– No button in galleryChristian
February 21, 2021 at 6:59 pm #1282623Hi,
Thank you, this script has been adjusted:function savvy_custom_mod(){ ?> <script> (function($){ $(window).on('av-height-change', function() { $('.av-masonry:not([class*="-gallery"]) .av-masonry-entry').each(function() { var more = $(this).find('.av-masonry-read-more'); var cont = $(this).find('.av-masonry-entry-content'); if( more.length == 1 ) return; cont.append('<div class="av-masonry-read-more">Read more</div>'); }); }); })(jQuery); </script> <?php } add_action('wp_footer', 'savvy_custom_mod');
Please ensure to clear your browser and any caching plugins before checking.
Best regards,
MikeFebruary 22, 2021 at 5:05 pm #1282850OK, thanks…now it works only for the Blogpost-masonry like i wished.
Thanks.Back to “the overlapping”
In your screenshot the elements are “seamless” and they have no margin anyway.
In my settings for the elements i have choosen “Big margins” :
[av_masonry_entries link='category,297' wc_prod_visible='' prod_order_by='' prod_order='' sort='no' items='-1' columns='3' paginate='load_more' query_orderby='date' query_order='DESC' size='flex' orientation='' gap='large' overlay_fx='' animation='active' id='' caption_elements='title excerpt' caption_styling='' caption_display='always' color='' custom_bg='' av-medium-columns='' av-small-columns='1' av-mini-columns='1' av_uid='av-mvl8fe' custom_class='']
And now the margin-bottom shrinks in the moment when the script finished loading:
douglas-consulting.de/screenshots/masonry.jpg
douglas-consulting.de/screenshots/masonry2.jpgYes, i do have custom CSS but it just puts a border and even if i remove the custom CSS the effect is the same:
Big gap before loading the button……no gap on the bottom after loadingIs this the proper class?
. av-masonry-entry isotope-item {}This is the class i used up to now for styling the masonry element and it worked so far, but even when i delete it, the margin issue is still there:
.avia_desktop.avia_transform3d .av-masonry-entry.av-masonry-item-loaded .av-inner-masonry { background: none repeat scroll 0 0 #fff; border: 1px solid #ccc; padding: 5px; box-shadow: 2px 3px 4px #cccccc; border-radius: 5px; margin-bottom: 15px;}
Kind regards
ChrisFebruary 22, 2021 at 5:45 pm #1282861And there are more issues with the masonry:
I see “title & description“…
– on big screens
– on small screens
– on medium screens i see only the titleThe inspector tells me that there is this:
@media only screen and (min-width: 767px) and (max-width: 989px) {
.responsive .av-masonry-entry .av-masonry-entry-title+.av-masonry-entry-content{! display:none;}}
But this is NOT part of my custom CSS, its from here:
…wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/masonry_entries/masonry_entries.css?ver=5.6.11: Why is Enfold deciding not to show my description instead of leaving it up to me?
2: How do i fix this?February 23, 2021 at 12:15 pm #1283051Hi,
I tested the masonry with the large gap and your css, and the issue I see is with your css, for example thepadding: 5px;
adds the padding like this (the green area):
as you notice it is displacing the inner-masonry. I would recommend removing this padding.
Themargin-bottom: 15px;
is increasing the “large gap”, I don’t believe that you wanted to increase the gap, so I would recommend removing this also (orange area):
as you can see, when the padding & margin is removed from your css, the issue is resolved:
Best regards,
MikeFebruary 23, 2021 at 11:06 pm #1283264The padding is important to get the border-effect i want.
But anyways i removed padding & margin and it did not change anything regarding the issue we are talking about.
The margin has, by the way, no effect on the gap.
I tested it with several amounts of pixels and there was no changeFebruary 24, 2021 at 2:31 pm #1283401Hi,
I’m not sure what you mean, on my localhost when I remove the css there are no issues?
Anyways this thread is starting to get off-topic, the topic of this thread is adding a “read more” button to the masonry items, and not the gallery. Which I was able to do for you.
While I would like to assist with your next topic of customizing the style your masonry items, I don’t see how this can effectively be done without seeing your site. I write this because often issues that I see are a result of css designed to target a different element and was not specific enough. This is one reason we typically ask to see the page you are working on, most css customization is not a “one-size-fits-all” situation.
We should close this thread as solved, and if you decide you would like more help customizing your masonry style and are willing to create a test page that we can work on together, then please open a new thread explaining what you are trying to achieve with a link, a screenshot is always welcome too.Best regards,
Mike -
AuthorPosts
- The topic ‘Read more buttin in masonry blogelement’ is closed to new replies.