Forum Replies Created
-
AuthorPosts
-
Cristian D.
ParticipantSure,
I think on the front-end is sorting by title and not by the admin order.
Can you help me please?
Thank youApril 2, 2021 at 2:16 AM in reply to: ✅How can I use the custom asset callback to render a block properly? #26891Cristian D.
ParticipantHi there!,
I created an slider for images using a custom block and custom assets for that block and everything is working fine on the front-end but isn't working completely because when I'm editing the page that contain that block the javascript files are not executing because the carousel isn't moving I think I called them correctly and are loading without problems but something isn't working and I can't figure it out what is the problem.
Do you know if I need to put something else to make this slider works correctly?
I would like to know if anyone can help me with this please.
Thank you
CUSTOM ASSETS CALLBACK
function slider_js(){ if(is_admin()){ //ADMIN NOT EXECUTING THE JAVASCRIPT INIT BUT ARE LOADING WITHOUT PROBLEMS $template_url = get_template_directory_uri(); wp_enqueue_style('swiper-slider-css', $template_url . '/assets/css/swiper-bundle.min.css', [], null); wp_enqueue_script('swiper-slider-js', $template_url . '/assets/js/swiper-bundle.min.js', [], null, true); wp_enqueue_script('swiper-slider-init', $template_url. '/blocks/slider/js/slider.js', ['swiper-slider-js'],null, true); }else{ //FRONT-END WORKS PRETTY WELL $template_url = get_template_directory_uri(); wp_enqueue_script('swiper-slider-init', $template_url. '/blocks/slider/js/slider.js', [],null, true); } }SWIPER SLIDER INIT
const slider = new Swiper('.slider-swiper .swiper-container', { speed: 700, loop:true, lazy: { loadPrevNext: true, loadPrevNextAmount: 2, }, parallax: true, autoplay: { delay: 4600, disableOnInteraction: false, }, pagination: { el: '.slider-swiper .swiper-pagination', clickable: true, }, navigation: { nextEl: '.slider-swiper .swiper-button-next', prevEl: '.slider-swiper .swiper-button-prev', }, });February 20, 2021 at 12:33 AM in reply to: ✅How can I use the custom asset callback to render a block properly? #24504Cristian D.
ParticipantThank you very much
February 19, 2021 at 1:58 AM in reply to: ✅How can I use the custom asset callback to render a block properly? #24482Cristian D.
ParticipantHi Long, Thank you for your help.
I was reading the documentation and I tried to use some custom assets on the block render area (using the AIO plugin) I can't get it work correctly.
When I did a preview of the code I saw that the functions() is displaying as a string and not outside of that string to call more assets.

Do you have some ideas that can I use to solve that?
Thank you
Cristian D.
Participantsame problem here 🙁 I have more than 5 sites broken because of that
Cristian D.
ParticipantThank you! I updated my PHP version and now is solved 🙂
Cristian D.
ParticipantThank you,
Now is working fine,
Best regardsCristian D.
ParticipantPROBLEM SOLVED!,
Never mind,
I updated my WordPress to the latest version and now is working fine,
ThanksCristian D.
ParticipantAwesome!
Thank you! -
AuthorPosts