fredericv
Forum Replies Created
-
Forum: Plugins
In reply to: [YMC Filter] Add jquery script after post-cards loadedJust to say : your support is the best plugin support I have ever seen π !! BRAVO !!
Forum: Plugins
In reply to: [YMC Filter] Add jquery script after post-cards loadedOk, I will do that π
Many thanks !
Forum: Plugins
In reply to: [YMC Filter] Add jquery script after post-cards loadedIt works in document.addEventListener(“DOMContentLoaded”)
Does it work within JQuery ?
Forum: Plugins
In reply to: [YMC Filter] Add jquery script after post-cards loadedOk, I put it in a javascript file, in jquery’s $(document).ready() function, but there’s an error :
The hook name can only contain numbers, letters, dashes, periods and underscores.Forum: Plugins
In reply to: [YMC Filter] Add jquery script after post-cards loadedOk, thanks.
I’ve found a solution with this code :
function waitForElement(selector, callback) {
const observer = new MutationObserver((mutations, observer) => {
const element = document.querySelectorAll(selector);
if (element) {
observer.disconnect();
callback(element);
}
});
observer.observe(document.body, {
childList: true,
subtree: true,
});
}then I use :
waitForElement('article.post-card', (element) => {
console.log('Element exists:', element);
});But I will try your solution.
Where do you put ymc hooks ?
Forum: Plugins
In reply to: [YMC Filter] Number of cards in carousel in responsive modeOk, I’ll take a look at this π
Thank you !
Forum: Plugins
In reply to: [YMC Filter] Get ACF field in Structural builder custom layoutYes, perfect ! I didn’t know shortcode_atts() function, it is the one to know π
Thank you very much
Forum: Plugins
In reply to: [YMC Filter] Get ACF field in Structural builder custom layoutYes, I am able to display perfectly an ACF field, like Data Picker. But I have to make some processes on it, not just display the field.
Have you an idea why I’m not able to access the post id through global $post or global $wp-query within a shortcode ?
Many thanks
Forum: Plugins
In reply to: [YMC Filter] Get ACF field in Structural builder custom layoutI’m afraid that doesn’t work for me.
I added a shortcode field [processacfdate] in card within structural builder, then in functions.php :
function process_acf_date() {
$id = get_queried_object_id();
echo “post Id = ” . $id . “<br/>”;
}
-> displayed “post Id : 0” π
The other global $post variable display nothing π
Forum: Plugins
In reply to: [YMC Filter] Get ACF field in Structural builder custom layoutThank you for your reply.
I have already tried this way, but I’m not able to get the ACF field from the global $wp_query within functions.php : the have_posts() functions return 0.
How do you get the current ymc query ?
Many thanks
Forum: Plugins
In reply to: [YMC Filter] Get ACF field in Structural builder custom layoutThanks for your very quick answer π
Your answer is almost perfect, the rendering is exactly what I’m needing ! But I need to do some extra processing on my ACF dates (I have in fact 2 dates, 1 for the beginning of an event, 1 for the ending, and I have to process it to properly display it) Do you think it’s possible ? How to do that ?
Many thanks !