YMC
Forum Replies Created
-
Forum: Plugins
In reply to: [YMC Filter] Add jquery script after post-cards loadedThanks!
Forum: Plugins
In reply to: [YMC Filter] Add jquery script after post-cards loadedGood Luck!
Forum: Plugins
In reply to: [YMC Filter] Add jquery script after post-cards loadedYes, it should work inside $(document).ready(), but we recommend you use native JavaScript, it’s more reliable!
Forum: Plugins
In reply to: [YMC Filter] Add jquery script after post-cards loadedSend us your JavaScript code. You probably added a bug somewhere )
Forum: Plugins
In reply to: [YMC Filter] Add jquery script after post-cards loadedFor reliability, you should use plugin hooks. You can add this code to your JavaScript files, for example in the section:
document.addEventListener("DOMContentLoaded", () => {
ymcHooks.addAction('ymc/grid/after_update', function(data, container) {
console.log('Posts are inserted into the DOM:', container);
console.log('Server response data:', data);
// Your code...
});
});Don’t forget to specify the filter ID in the function, for example:
ymcHooks.addAction('ymc/grid/after_update_72', function(data, container) { ..})
Here, 72 is the ID of your filter on the page!Forum: Plugins
In reply to: [YMC Filter] Add jquery script after post-cards loadedHi!
The filter’s post grid works asynchronously, not synchronously, so your javascripts don’t see the loaded posts. If you need to interact with the loaded posts, you should use hooks:ymcHooks.doAction('ymc/grid/after_update', data, container);ymcHooks.doAction('ymc/grid/after_update_filter_id', data, container);ymcHooks.doAction('ymc/grid/after_update_filter_id_instance_index', data, container);For example:
ymcHooks.addAction('ymc/grid/after_update', function(data, container) {
console.log('Posts are inserted into the DOM:', container);
console.log('Server response data:', data);
});OR
ymcHooks.addAction('ymc/grid/after_complete', function(status, container) {
if (status === 200) {
console.log('The request was completed successfully.');
}
});We recommend adding a filter ID (
filter_id) to the hook; this will allow you to avoid global application to all pages of the site. This will allow you to access the post card. Please check out the full list of hooks in the plugin documentation: https://github.com/YMC-22/YMC-Filter#javascript-integration-hooksWe hope this helps. We were happy to help!
Forum: Plugins
In reply to: [YMC Filter] Number of cards in carousel in responsive modeGood Luck!
Forum: Plugins
In reply to: [YMC Filter] Number of cards in carousel in responsive modeHi!
Mobile responsiveness is not supported in the plugin settings. You will need to customize all carousel (Swiper) settings. See the documentation for using custom plugin settings.
https://prnt.sc/WDy0fpwIb76-Forum: Plugins
In reply to: [YMC Filter] Matching SVN tag for the current versionHi!
Thanks for the reminder.
Forum: Plugins
In reply to: [YMC Filter] The category names are not updatingHi!
The old version of the plugin, 2.9, remains available for now, and you can revert to the older version at any time. To do so, go to the Settings section and select “Enable Legacy Version” (see screenshot). This ensures you can revert to your previous settings (no data will be lost). However, we recommend using the latest version of the plugin, as the older version is no longer supported.
Forum: Plugins
In reply to: [YMC Filter] The category names are not updatingUnfortunately, the old version of the plugin is no longer supported. You will need to update to the latest version of our plugin and re-create all filter settings. We recommend copying your styles and scripts to a separate file before updating and then adding the previously saved settings after the update. This is the safest and most correct solution. Since the plugin will be updated regularly in the future, it is recommended that you have the latest version of the plugin – it is reliable and secure. Please do not worry about updating. All your settings (styles and scripts) should be saved separately for now and then pasted into the plugin. If you encounter any problems, please contact us, and we will be happy to help. Good luck!
Forum: Plugins
In reply to: [YMC Filter] The category names are not updatingHi!
First, you’re using the old version of the plugin, 2.9.71. This release is no longer supported. You should update the plugin to the latest version 3.10.2. Then, make all the necessary settings in the plugin and retest to make sure everything is working correctly. Please let us know your results.Thanks.
Hi!
Regarding the first point, horizontal filter alignment only applies to the Default filter type. Other filter types need to be custom-styled to match your design. This can be done in the Advanced – Custom CSS section or in your custom link file. Regarding color management, please let me know what exactly isn’t working for your filters (please provide more detailed information on this point).
Then, regarding post sorting, you can set a meta key in the Appearance – Post Settings – Post Order By section and then select the desired option (see screenshot https://prnt.sc/SlrdKMOj3VJk).
Or, a better solution to this task is to use callback functions for the request. But this is a more complex implementation. See the documentation https://github.com/YMC-22/YMC-Filter#advanced-developer-hooksWe hope this helps.
Forum: Plugins
In reply to: [YMC Filter] Get ACF field in Structural builder custom layoutGood Luck!
Forum: Plugins
In reply to: [YMC Filter] Get ACF field in Structural builder custom layoutHi!
You can get the post ID within the shortcode itself. See example:add_shortcode( 'test_sc', function($atts) {
$atts = shortcode_atts( array(
'post_id' => get_the_ID(),
), $atts );
$post_id = intval($atts['post_id']);
return '<div>
The test shortcode works successfully! Post ID: '. $post_id .'
</div>';
});Then in the builder, insert the shortcode names (see screenshot)
https://prnt.sc/wz6oQqBto-4b
Thus, inside the shortcode you have the opportunity to get the post ID and make some calculations) We hope this helps you!