Topic: Integrating with WordPress - CSS/JS files can't be found

winusoft free asked 3 years ago


Expected behavior CSS/JS files should be found once enqueued.

Actual behavior When inspecting the page, the files have version numbers appended to their URLs, which is preventing them from being found.

Example: http://winusoft-new-co-uk.stackstaging.com/wp-content/themes/oxygen-is-not-a-theme/css/bootstrap.min.css?ver=5.2.3

Actual file: http://winusoft-new-co-uk.stackstaging.com/wp-content/themes/oxygen-is-not-a-theme/css/bootstrap.min.css

Page link: http://winusoft-new-co-uk.stackstaging.com/home/.

How do I get around the version number issue?

Resources (screenshots, code snippets etc.) Files have been enqueued using the Code Snippets plugin:

function winusoft_mdb_styles() { wp_enqueue_style( 'Font_Awesome', 'https://use.fontawesome.com/releases/v5.6.1/css/all.css' ); wp_enqueue_style( 'Bootstrap_css', get_template_directory_uri() . '/css/bootstrap.min.css' ); wp_enqueue_style( 'MDB', get_template_directory_uri() . '/css/mdb.min.css' ); wp_enqueue_style( 'Style', get_template_directory_uri() . '/style.css' ); wp_enqueue_script( 'jQuery', get_template_directory_uri() . '/js/jquery-3.3.1.min.js', array(), '3.3.1', true ); wp_enqueue_script( 'Tether', get_template_directory_uri() . '/js/popper.min.js', array(), '1.0.0', true ); wp_enqueue_script( 'Bootstrap', get_template_directory_uri() . '/js/bootstrap.min.js', array(), '1.0.0', true ); wp_enqueue_script( 'MDB', get_template_directory_uri() . '/js/mdb.min.js', array(), '1.0.0', true );

    }

add_action( 'wp_enqueue_scripts', 'winusoft_mdb_styles' );


Arkadiusz Cacko staff commented 3 years ago

Hi @winusoft! Could you please explain what do you mean about CSS/JS files should be found once enqueued. and what is the point of this issue? Regards


winusoft free commented 3 years ago

I'm now having a slightly different issue.

Instead of enqueueing the files in my WordPress install, I've added them to the site header and footer, and the files can now be found.

However, the carousel still isn't working - I'm getting the below error:

Uncaught TypeError: $(...).mdbCarousel3d is not a function.

You can see the error in dev tools here: https://winusoft.co.uk/carousel/.

Do you know what I need to do to get this to work?


winusoft free answered 3 years ago


Perfect, thank you. I hadn't added the carousel files.


MDBootstrap staff commented 3 years ago

Great to hear that. This case is answered and resolved so I close this ticket. Have a good day.


MDBootstrap staff answered 3 years ago


Hi winusoft,

Carousel3d is a plugin that you need to buy from our plugins page. You can read more about using this component in the documentation. You need to add its js and css file to your project. https://mdbootstrap.com/plugins/jquery/carousel-3d/

If you already purchased this plugin simply copy files

MDB-Carousel-3D_4.8.10/css/addons/mdb-carousel-3d.min.css

MDB-Carousel-3D_4.8.10/js/addons/mdb-carousel-3d.min.js

to your project and link to the CSS file in header and js under MDB initialization in the body.

If you need additional help I am here for you.

Best Regards, Piotr


FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Closed

Specification of the issue

  • User: Free
  • Premium support: No
  • Technology: General Bootstrap questions
  • MDB Version: -
  • Device: PC
  • Browser: Chrome Version 77.0.3865.90 (Off
  • OS: Windows 10 x64
  • Provided sample code: No
  • Provided link: Yes