Forum Replies Created
-
AuthorPosts
-
Hi,
Thanks for your reply ! I managed to make it work. For those who want to know, the way I did it was to add in the ajax call success something like :
if(response.content.indexOf('avia-content-slider-active') > -1) { $( '.avia-content-slider-active' ).aviaSlider({wrapElement: '.avia-content-slider-inner', slideElement: '.slide-entry-wrap', fullfade: true}); }
I had to get rid of the container variable because it was not defined, and some things don’t seem to work (like the custom class on the slider, theorically inserted through the custom_class parameter of the shortcode, but that doesn’t really matter).
Just out of curiosity, is there other elements like this that have an ‘activation function’ ? If so, is there somewhere a list of them ?
Best,
For your information, here is the code for the content fetching :
function fetch_oeuvre_content() { // Check nonce for security check_ajax_referer('ajax_nonce', 'nonce'); $oeuvreId = sanitize_text_field($_POST['oeuvre']); $previousoeuvreId = sanitize_text_field($_POST['poeuvre']); $nextoeuvreId = sanitize_text_field($_POST['noeuvre']); $masonryId = sanitize_text_field($_POST['masonry']); $post = get_post($oeuvreId); if (!empty($post)) { $post_id = $post->ID; $content = do_shortcode("[jmpeynetoeuvre pid='".$post_id."' previous_id='".$previousoeuvreId."' next_id='".$nextoeuvreId."' masonry_id='".$masonryId."']"); // Get the content and apply content filters // Prepare and send JSON response wp_send_json(array( 'content' => $content )); } else { echo 'Definition not found.'; } wp_die(); // This is required to terminate immediately and return a proper response } add_action('wp_ajax_fetch_oeuvre_content', 'fetch_oeuvre_content'); add_action('wp_ajax_nopriv_fetch_oeuvre_content', 'fetch_oeuvre_content');
And the shortcode that is used :
function shortcode_jmpeynetoeuvre( $atts ){ global $post; $post_id = $post->ID; $atts = shortcode_atts( [ 'pid' => $post_id, 'previous_id' => '', 'next_id' => '', 'masonry_id' => '', ], $atts ); $pid = $atts['pid']; $previousid = $atts['previous_id']; $nextid = $atts['next_id']; $masonryid = $atts['masonry_id']; $classpopup = ''; $classpopupbonus = ''; $oeuvretitle = get_the_title($pid); if (get_the_post_thumbnail_url($pid, "full")) {$oeuvreimagethumb = get_the_post_thumbnail_url($pid, "full");$oeuvreimagethumbid = attachment_url_to_postid($oeuvreimagethumb);} else {$oeuvreimagethumb = '';$oeuvreimagethumbid = '';} if (get_field("oeuvre_annee", $pid)) {$oeuvredate = esc_html(get_field( "oeuvre_annee", $pid ));} else {$oeuvredate = '';} if (get_field("oeuvre_technique", $pid)) {$oeuvretechnique = esc_html(get_field( "oeuvre_technique", $pid ));} else {$oeuvretechnique = '';} if (get_field("oeuvre_legende", $pid)) {$oeuvrelegende = get_field( "oeuvre_legende", $pid );} else {$oeuvrelegende = '';} $oeuvreportaitpaysage = get_field("oeuvre_portait_paysage", $pid); if (get_field("oeuvre_image", $pid)) {$oeuvreimage = get_field( "oeuvre_image", $pid );$oeuvreimageurl = wp_get_attachment_url( $oeuvreimage );$classpopup = 'oeuvre-image '.$oeuvreportaitpaysage;} else {$oeuvreimage = '';} if (get_field("oeuvre_flipbook_v2", $pid)) {$oeuvreflipbook = get_field( "oeuvre_flipbook_v2", $pid );$classpopup = 'oeuvre-flipbook';} else {$oeuvreflipbook = '';} if (get_field("oeuvre_son", $pid)) {$oeuvreson = get_field( "oeuvre_son", $pid );$classpopup = 'oeuvre-son';} else {$oeuvreson = '';} if (get_field("oeuvre_video", $pid)) {$oeuvrevideo = get_field( "oeuvre_video", $pid );$classpopup = 'oeuvre-video';} else {$oeuvrevideo = '';} if (get_field("oeuvre_citation", $pid) == 'oui') {$oeuvrecitation = get_field( "oeuvre_citation", $pid );$classpopup = 'oeuvre-citation';} else {$oeuvrecitation = '';} $oeuvrelien = get_post_permalink($pid); $oeuvreslug = get_post_field( 'post_name', $pid ); $lienetoilee = __( 'Cliquez ici pour un supplément d’âme', 'peynet'); $output = ''; $output .= '<div id="'.$oeuvreslug.'" class="popup-oeuvre-principale '.$classpopup.' ">'; $output .= '<div class="avia-section main_color avia-section-default avia-no-border-styling el_after_av_one_full el_before_av_section avia-bg-style-scroll av-minimum-height av-minimum-height-100 av-height-100 container_wrap fullsize"><div class="container av-section-cont-open"><div class="template-page content av-content-full alpha units"><div class="post-entry post-entry-type-page "><div class="entry-content-wrapper clearfix jmcustompopupcontainer">'; // Bloc titre, date, technique $output .= '<div class="titredatetechniquecontainer">'; $output .= '<div class="titredatetechnique">'; $output .= '<p class="oeuvre-titre">'.$oeuvretitle.'</p>'; if (get_field("oeuvre_annee", $pid)) {$output .= '<p class="oeuvre-annee">'.$oeuvredate.'</p>';} if (get_field("oeuvre_technique", $pid)) {$output .= '<p class="oeuvre-technique">'.$oeuvretechnique.'</p>';} if (get_field("oeuvre_legende", $pid)) {$output .= '<p class="oeuvre-legende">'.$oeuvrelegende.'</p>';} $output .= '</div></div>'; // Bloc contenu principal $output .= '<div class="contenuprincipaloeuvrecontainer">'; $output .= '<div class="contenuprincipaloeuvre">'; if (get_field("oeuvre_image", $pid)) { $output .= '<div class="contenuprincipaloeuvreimage">'; $output.= do_shortcode ("[av_image src='".$oeuvreimageurl."' attachment='".$oeuvreimage."' attachment_size='full' src_dynamic='' copyright='' caption='' image_size='' styling='' box_shadow='none' box_shadow_width='10' box_shadow_color='' align='center' font_size='' overlay_opacity='0.4' overlay_color='#000000' overlay_text_color='#ffffff' link='' link_dynamic='' target='' animation='no-animation' animation_duration='' animation_custom_bg_color='' animation_z_index_curtain='100' parallax_parallax='' parallax_parallax_speed='' av-desktop-parallax_parallax='' av-desktop-parallax_parallax_speed='' av-medium-parallax_parallax='' av-medium-parallax_parallax_speed='' av-small-parallax_parallax='' av-small-parallax_parallax_speed='' av-mini-parallax_parallax='' av-mini-parallax_parallax_speed='' hover='' blur_image='' grayscale_image='' fade_image='' appearance='' css_position='' css_position_location=',,,' css_position_z_index='' av-desktop-css_position='' av-desktop-css_position_location=',,,' av-desktop-css_position_z_index='' av-medium-css_position='' av-medium-css_position_location=',,,' av-medium-css_position_z_index='' av-small-css_position='' av-small-css_position_location=',,,' av-small-css_position_z_index='' av-mini-css_position='' av-mini-css_position_location=',,,' av-mini-css_position_z_index='' transform_perspective='' transform_rotation=',,,' transform_scale=',,' transform_skew=',' transform_translate=',,' av-desktop-transform_perspective='' av-desktop-transform_rotation=',,,' av-desktop-transform_scale=',,' av-desktop-transform_skew=',' av-desktop-transform_translate=',,' av-medium-transform_perspective='' av-medium-transform_rotation=',,,' av-medium-transform_scale=',,' av-medium-transform_skew=',' av-medium-transform_translate=',,' av-small-transform_perspective='' av-small-transform_rotation=',,,' av-small-transform_scale=',,' av-small-transform_skew=',' av-small-transform_translate=',,' av-mini-transform_perspective='' av-mini-transform_rotation=',,,' av-mini-transform_scale=',,' av-mini-transform_skew=',' av-mini-transform_translate=',,' mask_overlay='' mask_overlay_shape='blob' mask_overlay_size='contain' mask_overlay_scale='100%' mask_overlay_position='center center' mask_overlay_repeat='no-repeat' mask_overlay_rotate='' mask_overlay_rad_shape='circle' mask_overlay_rad_position='center center' mask_overlay_opacity1='0' mask_overlay_opacity2='1' mask_overlay_opacity3='' title_attr='' alt_attr='' img_scrset='' lazy_loading='disabled' id='' custom_class='' template_class='' av_element_hidden_in_editor='0' sc_version='1.0' admin_preview_bg=''][/av_image] "); $output .= '</div>';} if (get_field("oeuvre_flipbook", $pid)) { $output .= '<div class="contenuprincipaloeuvreflipbook">'; // $output .= do_shortcode ("[real3dflipbook pdf='".$oeuvreflipbook."']"); $output .= do_shortcode (' [dflip id="'.$oeuvreflipbook.'"][/dflip]'); $output .= '</div>';} if (get_field("oeuvre_son", $pid)) { $output .= '<div class="contenuprincipaloeuvreson">'; $output .= do_shortcode ("[sc_embed_player fileurl='".$oeuvreson."']"); $output .= '</div>';} if (get_field("oeuvre_video", $pid)) { $output .= '<div class="contenuprincipaloeuvrevideo">'; $output .= do_shortcode ("[av_video src='".$oeuvrevideo."']"); $output .= '</div>';} if (get_field("sliderimages", $pid)) { $output .= '<div class="contenuprincipaloeuvreslider">'; $output.= do_shortcode ("[jmpeynetslider bonus='non' pid='".$pid."']"); $output .= '</div>';} $output .= '</div></div>'; // Bloc lien vers bonus $output .= '<div class="bonuslinkcontainer">'; if (get_field("oeuvre_bonus", $pid) == 'oui') { $output .= '<div class="bonuslink open-popup-bonus-link" datalink="#bonus-'.$oeuvreslug.'">'; $output .= $lienetoilee; $output .= '</div>'; } $output .= '</div>'; // Closing the main container $output .= '</div></div>'; $output .= '<div class="peynetmasonry-navigation-container">'; if($previousid) {$output .= '<a href="#" class="type-oeuvre navigation-link" data-av-masonry-item="'.$previousid.'" data-linkcurrentmasonryid="'.$masonryid.'"> < </a>';} $output .= '<div style="width:5px;"></div>'; if($nextid) {$output .= '<a href="#" class="type-oeuvre navigation-link" data-av-masonry-item="'.$nextid.'" data-linkcurrentmasonryid="'.$masonryid.'"> < </a>';} $output .= '</div>'; $output .= '<button title="Close (Esc)" type="button" class="mfp-close">×</button>'; $output .= '</div></div></div>'; $output .= '</div>'; return $output; } add_shortcode('jmpeynetoeuvre', 'shortcode_jmpeynetoeuvre');
I know it’s a lot, but I wanted to give you all the necessary elements. The ‘jmpeynetslider’ shortcode creates a content slider from an ACF WYSIWYG field filled with multiple pictures.
Best
Thanks Guenni007, I’ve already implemented that particular change.
I guess we can close the thread now :)
Well, I feel silly – you’re right, it works when I stop using Private Mode on my browser… Interesting though that the rest of the theme and customization works but not this particular addition. I would have to try to look into that sometime…
Sorry for that, and thanks !
Hi Guenni,
It is ! That’s why I mentionned you in the first post. I often stumble on your posts when I come to find ways to customize Enfold… Your tips and tricks have been very useful for several years now!
Thanks for the tip, by the way. I corrected that. Sadly, it doesn’t solve the problem I mentionned (the script doesn’t seem to load on page reload or revisit without clearing the browser cache) – problem which, if you still take care of the website mentionned in that old thread (https://webers-testseite.de/lightboxes/), affects it too…Would trying to tie the script to avia-defaut change that ?
Using something likeif ( wp_script_is( 'avia-default', 'registered' ) ) { wp_add_inline_script( 'avia-default', '
?
Hi Ismael,
Thanks for your help. Sadly, that didn’t work. So I tried different things, and here are a few other elements that might help :
– when changing to another theme (like Twenty Twenty-Two), and adding a new product, the product image worked as intended, by which I mean that on the product page, when clicking on ‘Define featured image’ and uploading a new picture and selecting it, the proper thumbnail (uncropped) appeared on the page. I then saved the product and switched back to Enfold, and it kept the right uncropped thumbnail. And on the catalog, I could see the right, uncropped thumbnail.
– So I tried something else. I disabled the shop_catalog image size in my child theme function.php, changed back the woocommerce/config.php file to what it was originnaly, and then retried the whole process ; this time, even with Enfold activated, everything happened as it should – meaning I get my uncropped thumbnail. But if I reinstate the ‘shop_catalog image size, it starts picking it up again and not the woocommerce_thumbnail one.
And if I select a semi-old picture (one dating from no before the end of August), and the 450×450 pixel file exists on the server, it will get picked up even though the image size ‘shop_catalog’ is still removed. Regenerating the thumbnails and deleting the unused ones makes it work again.So it seems that somehow, the existence of the shop_catalog sized image is enough for it to take precedence over any other thumbnail…. Once again, I encourage you to try things out on the website I gave you. It truly baffles me.
Thanks for your help !
Hi Ismael,
Thanks for your answer. Before I start fiddling with stuff, I would just like to confirm that the function to allow the use of customized templates for the shortcodes also works for the shortcode helpers. The modified file (class-avia-product-slider.php) is located in the avia-shortcode-helpers folder, not the avia-shortcode folder ; won’t I need to adjust the function or to create a special sub-folder ?
Cheers, and thanks again !
Ah, sorry, the error you saw with the custom script is because the test site didn’t have the last version of it that makes it not activate on pages where it shouldn’t. That has been corrected.
The main issue still remains, though, as you can see.Hi,
Sorry, as I’ve said, I don’t think the problem is due to the “pu-link” class and the associated script, but with the Blog Articles avia element with the ‘Filter by date’ setting.
On the pages that are showing the critical error, if you change this settings in the relevant avia block, the problem goes away. I’ll give you access in private so you can check it out.The custom script you’re referring to is for adding aria-labels to the pagination links of the accessible version of the document library (when you click on ‘Mediatheque’, then on the button that says ‘Contenu alternatif’, it’s the pagination links at the bottom of the popup). This script is not active on the pages where the critical error happens ; what kind of issue did you notice with this one ?
Hi again,
I think I’ve found the issue…
Here is the relevant passage in postslider.php (I looked in 4.8.6.2), around line 1106 :$date_query = array(); if( 'date_filter' == $params['date_filter'] ) { $date_query = AviaHelper::add_date_query( $date_query, $params['date_filter_start'], $params['date_filter_end'], $params['date_filter_format'] ); }
And here the same passage in postslider.php in 4.8.7, around line 1131 :
$date_query = AviaHelper::date_query( array(), $params );
But apparently, jut replacing one with the other is not enough to make it work again.
Could you help ?
Thanks !
Hi again,
I’m sorry, I had misdiagnosed the problem… It actually appears that it is the ‘filter by date’ feature in the Blog Article avia element that bugs out. I use it on the pages mentionned, to selectively show some specific blog posts in a section of the page.As soon as, in the builder, I change this parameter (and decide to ‘show all’ or filter by time period’), everything works again. Maybe a typo in there ? Where should I look to check this ?
Oh, and since the problem is not at all what is in the title, should I make a new thread ?
Thanks !
Hi Ismael,
I’ll try. Thanks for your help, and thanks also to Guenni007 (I’ve seen a lot of your posts on these forums, and I appreciate all that you do for us Enfold users !)Cheers !
Hi,
Thanks for your help again. I was able to get rid of the error message – I just got the sti function “out” (see below) -, but the sticky post are not in first position in the grid (see links and explanations in private), which was the point of it all… Any idea ?
Thanks again !
// sticky posts function stipendus($n) { settype($n, 'int'); return $n ; } add_filter('avia_post_slide_query', 'avia_post_slide_query_mod_jm', 10, 2); function avia_post_slide_query_mod_jm($query, $params) { $include = array(); $sticky = get_option( 'sticky_posts' ); $args = array( 'taxonomy' => $params['taxonomy'], 'post__not_in' => $sticky, ); $posts = get_posts( $args ); foreach($posts as $post) { $include[] = $post->ID; } $include = array_merge($sticky, $include); // convert values of the $include from string to int $include = array_map("stipendus", $include); $query['post__in'] = $include; return $query; }
Hi Guenni,
Thanks for your help, but I’m afraid I wasn’t clear. When I switched the filter, I didn’t paste a new function, but changed the old one – and I do not have the two functions active at the same time (I comment out the bump_sticky_posts_to_top when I test the other one).
So the problem wasn’t with me having two avia_blog_post_query_mod functions.No, the interesting thing is when I paste the code (for the avia_blog_post_query_mod function), it tells me that the sti function (included in the code) causes the problem. When I change the name of the main function (avia_blog_post_query_mod) this doesn’t change. And when , in the code, I change the name of the sti function (to for example stipendous), the error message changes too and tells me stipendous is already declared on line 1048 so I cannot redeclare it on line 1048.
What is annoying is that I tried copying the code on another website, and the error doesn’t happen, which makes sense – but why is it not working on this website ?
Thanks for the help !
Hey Ismael,
Thanks for that. I’ve tried the code, and something weird happens : I cannot save the function.php file, and when I do, it causes a critical error on the site. When I try to save and it doesn’t, here’s what it’s telling me :
Your php code modifications have been cancelled due to an error on line 1048 of the file wp-content/themes/ActifsDV/functions.php. Please correct it and try to save again.
Cannot redeclare sti() (previously declared in wp-content/themes/ActifsDV/functions.php:1048)It seems kind of weird, because the mistake seems to happen on the same line that the function sti is first declared ?
Thanks for your help !
Excellent !
As usual, you guys are doing a top notch job.
Thanks for everything !
(we can close this ticket)Ah, yes, I forgot about that option…
Thanks, it does work much better now (there are still a couple of problems, but if it’s just one, that’s much better !)Any idea when the corrected file would be integrated into an official Enfold release (if there is one coming soon) ? Or should I just use your temp file for now ?
Cheers !
Hi,
Thanks for your help. Sadly, it didn’t seem to work… The padding rules are still affected. I put in private two links : one is the actual website (still with 4.8.3) and the other is a copy with 4.8.5 and the new file you gave me.
I did empty the caches (site + browser) ; but it appears that the new css rules still apply, and still have #top in front of them for padding and corners. Look for example at the white ‘Focus’ block.I’d appreciate if you could take a look !
Thanks !
March 30, 2021 at 4:09 pm in reply to: Frontend publisher pro insert Media object button not working #1291391Hi,
You’re right, it works – this is great news. Sorry about that then, I was sute I’d tried all the settings in there…Thanks !
We can close the thread then.
March 29, 2021 at 9:53 am in reply to: Frontend publisher pro insert Media object button not working #1291046Hi,
Thanks. I’ll be keeping an eye out on this one. I hope you find a solution, because for most clients, giving access to the backend is a bad idea… So frontend interactions are a must.Cheers, and thanks again for your help !
March 25, 2021 at 11:48 am in reply to: Frontend publisher pro insert Media object button not working #1290348The simplest is probably to give you FTP details (see private), but careful, there’s a lot going on there :)
And I’m not worried about the time it takes ; as I said, for the current project, I switched themes, but I would rather avod that for future ones.Thanks !
March 21, 2021 at 8:57 pm in reply to: Frontend publisher pro insert Media object button not working #1289491Hi,
Thanks for your help. Deactivating plugins is one of the first thing I did, without success (you can try too). And same as you, I don’t see any error messages that could point toxards where the problem is… Maybe a JQuery version ? I tried to deactivate JMigrate in Enfold, but that didn’t change anything either. Maybe both Enfold and the plugins (the problem is with the frontend post publishing and the frontend document publishing) define similar functions for frontend media library management ? I have to say I have no idea…Best !
March 17, 2021 at 3:50 pm in reply to: Frontend publisher pro insert Media object button not working #1288741Oups, in the previous message, one of the adress was still for the original site. The correct one is in private.
March 17, 2021 at 2:27 pm in reply to: Frontend publisher pro insert Media object button not working #1288728Okay, the duplicate website is up. I’ve switched back to Enfold already. I’ll give you the url in private.
Thanks for your help !
March 17, 2021 at 12:04 pm in reply to: Frontend publisher pro insert Media object button not working #1288709Hi,
Thanks for taking the time to test this. Sadly, it works because I changed theme (the project is urgent, so I just went ahead). But I’m still very much interested in finding a solution to the problem for future websites ; I’ll duplicate the site and give you the new url, so you can switch back to enfold and analyse the problem.March 13, 2021 at 5:55 pm in reply to: Frontend publisher pro insert Media object button not working #1288039I will, but that makes it two plugins that have a similar problem just because of enfold (Frontend publishing pro and wordpress download manager). Changing theme does solve the problem. Is there anything you could tell me that would help narrow it down ? I would really like to keep using enfold… For example, which scripts in enfold might be lnked to that ? That might help me with the plugins’ authors.
Thanks !
March 12, 2021 at 10:35 pm in reply to: Frontend publisher pro insert Media object button not working #1287888Oh, and the same thing seems to be happening for the file manager I also use on this site, that has a frontend uploader… See link and explanations in private.
Thanks for your help !
Hi Ismael,
Thanks for your help. I finally went with a tuned-down modal, that avoid the aforementionned problems… We can, I think, close the thread.Cheers !
Excellent, thank you !
I think we can close this thread now.
Cheers ! -
AuthorPosts