Forum Replies Created
-
AuthorPosts
-
Thanks all and the solution above works perfectly. Thank you Guenni007
Hey Mike, yes please and I’ve not tested the other suggestions yet. If the over extension of the border can be fixed with CSS then that solves the issue. Any ideas very much appreciated.
Hey Ismael
Excellent thanks and I’ve combined the two functions for simplicity and posting here if anyone else wants a function that adds custom fields to grid posts (ALB) and single posts (Non-ALB).
// Helper function to generate the custom event details HTML function generate_custom_event_details($post_id) { $event_date = get_post_meta($post_id, 'event_date', true); $event_time = get_post_meta($post_id, 'event_time', true); $event_location = get_post_meta($post_id, 'event_location', true); $custom_output = '<div class="custom-event-details">'; if ($event_date) { $custom_output .= '<p class="event-date"><strong>Event Date:</strong> ' . esc_html($event_date) . '</p>'; } if ($event_time) { $custom_output .= '<p class="event-time"><strong>Event Time:</strong> ' . esc_html($event_time) . '</p>'; } if ($event_location) { $custom_output .= '<p class="event-location"><strong>Event Location:</strong> ' . esc_html($event_location) . '</p>'; } $custom_output .= '</div>'; return $custom_output; } // Filter for avf_post_slider_entry_excerpt add_filter('avf_post_slider_entry_excerpt', function ($excerpt, $prepare_excerpt, $permalink, $entry, $context) { $custom_output = generate_custom_event_details($entry->ID); // Check if the "Read More" link exists in the excerpt $read_more_position = strpos($excerpt, '<a'); if ($read_more_position !== false) { // Insert the custom output before the "Read More" link $before_read_more = substr($excerpt, 0, $read_more_position); $read_more_and_after = substr($excerpt, $read_more_position); return $before_read_more . $custom_output . $read_more_and_after; } // Append custom output if no "Read More" link is found return $excerpt . $custom_output; }, 10, 5); // Filter for the_content add_filter('the_content', function ($content) { if (is_singular('post')) { $custom_output = generate_custom_event_details(get_the_ID()); $content .= $custom_output; } return $content; }, 10);
Hi Ismael, thanks for the possible solution and I have tried the following but with limited results the border extends to far.
The dev site is below, thanks.
.av-frame.av-frame-top.av-frame-vert { box-shadow: 0 -29px 0px 30px black; } .av-frame.av-frame-bottom.av-frame-vert { box-shadow: 0 8px 0px 9px black; } .av-frame.av-frame-left.av-frame-hor { box-shadow: 0 0px 0px 1px black; } .av-frame.av-frame-right.av-frame-hor { box-shadow: 0px 0px 0px 1px black; }
Hey Ismael, that’s great thanks it worked. Although the fields appeared after the Read More button so I have adjusted the code. Not sure if it’s the most tidy way of doing it though.
add_filter('avf_post_slider_entry_excerpt', function ($excerpt, $prepare_excerpt, $permalink, $entry, $context) { $event_date = get_post_meta($entry->ID, 'event_date', true); $event_time = get_post_meta($entry->ID, 'event_time', true); $event_location = get_post_meta($entry->ID, 'event_location', true); // Prepare custom output $custom_output = '<div class="custom-event-details">'; if ($event_date) { $custom_output .= '<p class="event-date"><strong>Event Date:</strong> ' . esc_html($event_date) . '</p>'; } if ($event_time) { $custom_output .= '<p class="event-time"><strong>Event Time:</strong> ' . esc_html($event_time) . '</p>'; } if ($event_location) { $custom_output .= '<p class="event-location"><strong>Event Location:</strong> ' . esc_html($event_location) . '</p>'; } $custom_output .= '</div>'; // Check if the "Read More" link exists in the excerpt $read_more_position = strpos($excerpt, '<a'); if ($read_more_position !== false) { // Insert the custom output before the "Read More" link $before_read_more = substr($excerpt, 0, $read_more_position); $read_more_and_after = substr($excerpt, $read_more_position); return $before_read_more . $custom_output . $read_more_and_after; } // Append custom output if no "Read More" link is found return $excerpt . $custom_output; }, 10, 5);
Hi Ismael
Thanks for the reply and I’m using the builder. Here’s the URL and it’s the three column grid posts sections.
Richard
August 20, 2024 at 5:18 pm in reply to: Different logo on pages and posts (transparent header) #1464993Excellent and a super easy fix — doh, why didn’t I think of that.
Super
Thanks
RichardAugust 20, 2024 at 11:03 am in reply to: Different logo on pages and posts (transparent header) #1464961Hi Mike
Sorry for the delay in replying and I managed to get that working from the thread. The only bit I need to fix now is for the page to use the same logo on the mobile view. See URL (switch between desktop and mobile)
Thanks
RichardHey there, this is very useful and I’ll test on one of my other Enfold sites.
Thanks
RichardHey Ismael
This is fantastic thank you. Been trying to find a fix for years for the submit button styling.
Richard
- This reply was modified 6 months, 3 weeks ago by raslade.
Hey Mike, no problem and that’s perfect — exactly what I needed and will have a go at implementing.
Richard
Hey Nikko
Perfect thank you and all fixed. Yes, another reason why Enfold is so awesome — the support always delivers :-)
Richard
Hey Nikko
Thanks for the solution although I couldn’t find that code on line 658. I did find
if($.avia_utilities.isMobile) return; if( $('body').hasClass( 'av-disable-avia-hover-effect' ) ) { return; }
On line 601 but removed, cleared but no luck.
Thanks
RichardWell that was too simple. I feel a little foolish but it’s very much appreciated, thank you.
Richard
Hey Mike, OK i’ll give that a go and test on another machine that has earlier versions.
Richard
Hey Mike
Agreed and you say fixed. I may have to look at altering the search field as I can’t guarantee that all visitors will have the lastest version. Do you know and CSS that might lock it in place?
Thanks
RichardHey Mike, thanks for checking. They were using v105 then once updated it was OK. Not sure that helps though as ideally like the menu to be backward compatible.
Richard
Hi there, thanks for checking. One of my colleagues on a PC using Chrome has managed to replicate the issue https://share.vidyard.com/watch/XtsKMhDs4DSBAae9oz3JUa?autoplay=1&vyetoken=5548d107-6394-4cde-ae02-3f5f6203d36f
Thanks
RichardSorry yes, that would be useful. No screenshot is needed. Basically, the search field disappears once activated or hovered over.
Richard
December 9, 2021 at 12:37 pm in reply to: How to disable menu delay on hover (main, sub and mega-menus) #1332111Thank you and yes please you can close the ticket.
Richard
December 9, 2021 at 9:24 am in reply to: How to disable menu delay on hover (main, sub and mega-menus) #1332082Hey Ismael
Rookie mistake — forgot to check that js merge was disabled. Sorted and thanks for your help once again.
Richard
Yes thank you the topic can be closed now.
Hey Ismael
Of course, simple and elegant:
#avia-menu #menu-item-search { opacity: 0; } #avia2-menu #menu-item-search { opacity: 1; }
Excellent support as always, thank you.
Richard
Hey Ismael, thanks for getting back to me and I’ve got it working now with this adjustment. The session has to be unique so I tested using new private browser windows each time. This replicates what new visitors would see.
Thanks
RichardIgnore my question I’ve just spotted that this function has been integrated with the latest version of Enfold.
May 25, 2021 at 9:50 pm in reply to: Blog grid — title, excerpt and read more link with post type link #1302321Thanks Ismael. With a slight tweak it works perfectly, thank you.
Final code (that works for blog grid) if anyone else needs it:
// a custom script // use external link function ava_custom_script_mod() { if ( wp_script_is( 'avia-default', 'registered' ) ) { wp_add_inline_script( 'avia-default', ' (function($) { $(document).ready(function() { $(".post-format-link .more-link").on("click", function(e) { if(e.preventDefault) e.preventDefault(); var content = $(this).parents(".slide-content"); var header = content.find(".entry-content-header"); var external_link = header.find("a").attr("href"); window.open(external_link, "_blank" ); }) }); })(jQuery); '); } } add_action( 'wp_enqueue_scripts', 'ava_custom_script_mod', 9999);
May 24, 2021 at 11:32 am in reply to: Blog grid — title, excerpt and read more link with post type link #1301966Hey Mike, not a problem, we all need a weekend ;-)
I’ve adjusted the code but then the site wouldn’t load. I tried changing the PHP version but no luck. I’m running 4.8.1 with PHP 7.4.16
Thanks
RichardMay 21, 2021 at 4:53 pm in reply to: Blog grid — title, excerpt and read more link with post type link #1301682Hey Ismael, there are many reasons why I love Enfold — an amazing support forum is definitely one of them and this works perfectly, thank you. One final question related to the link. I’ve added the following to the functions file to force links to open a new page:
add_filter('wp_footer', 'avf_add_target_blank', 10); function avf_add_target_blank() { ?> <script> (function($){ $(window).load(function() { $( ".avia-content-slider .slide-entry-title a, .more-link" ).each(function() { $(this).attr('target','_blank'); }); }); })(jQuery); </script> <?php }
It correctly adds target=”_blank” to the code but for some reason doesn’t open a blank page.
I’ve tried a.more-link, .more-link a, .read-more-link .more-link a, but still no luck. Am I missing something?
Thanks
RichardAll good thanks, please close the thread.
Great thank you.
Richard
-
AuthorPosts