How do I access site and block editor state data and use `useSelect()` or `withSelect()` to bind it to my components?

✨ Intro to the Gutenberg Data Module ✨ Gutenberg’s core data model shares a lot of the API and ideology of the state-management library Redux, with a number of differences. Reading up on Redux can provide a lot of insight into how Gutenberg’s data management functions. This lecture will be on the final exam. Application … Read more

how to include javascript file and css file in wordpress

WordPress already ships with jQuery. There is no need to include it in your theme. Javascript Let’s say your jquery.tabify.js file is located in /js/jquery.tabify.js in your theme. Include the following code in your functions.php file: function jquery_tabify() { wp_enqueue_script( ‘jquery-tabify’, get_template_directory_uri() . ‘/js/jquery.tabify.js’, array( ‘jquery’ ) ); } add_action( ‘wp_enqueue_scripts’, ‘jquery_tabify’ ); This will … Read more

How to correctly add JQuery in a WP theme?

When you register/enqueue your other scripts, simply pass jQuery as the third parameter and it will be loaded first and only once, from the local WordPress files: wp_register_script( ‘theme-js’, get_template_directory_uri() . ‘/js/theme.js’, array( ‘jquery’) ); If you only need the jQuery, simply use: wp_enqueue_script(‘jquery’); You can find a list here about the javascript libraries that … Read more