you must use enqueue script and style commands to include wp.
for it, look at these links:
https://developer.wordpress.org/reference/functions/wp_enqueue_script/
https://developer.wordpress.org/reference/functions/wp_enqueue_style/
also dont use hard php commands like this : <?php echo(__DIR__) ?>
there are wp commands for these jobs.
you can use below:
plugin_dir_path
plugins_url
plugin_dir_url
plugins_url
Related Posts:
- How to get the path to the current theme?
- Symbolic Links on dev box with plugins and stylesheets
- How to include class from addon after to be sure one class exists in the main plugin?
- Plugin base URL
- include wp-blog-header not working on MAMP
- Widget is to be compatible with all themes
- Serve text/html from wp-json API via WPEngine, headers not being set properly
- get_option() not returning expected value from plugin
- Following WordPress Markup Is mandatory, got awkward resultyby wordpress standard markup?
- include php file if page_id matches
- How to remove default style of header in wordpress metabox
- CSS not affecting widget output
- Include file in plugin file
- How to change WooCommerce loop product title HTML output in single product page and archive page
- Plugin path comes wrongly
- How to get post image root URL?
- Best practice for Designing a Plugin with this scenario
- Include HTML (Bootstrap Modal Box) with a plugin into my header
- A function that will remove HTML and tags from a string?
- Loading Images from Javascript on the Front End
- can’t access some WordPress function from my plugin
- Font size of HTML content
- Multiple TinyMCE on button click is initialized and appended but why only last one is writeable?
- Including content into an add_shortcode() function
- How do I show the HTML descrption in wordpress photo gallery for my individual gallery pages?
- How to include files in the loop via ajax
- Implementing Select2 plugin into WordPress
- How can I add the Post ID to Class Name in Jquery?
- How to get html tag ids from template?
- Which subset of html does WordPress support?
- How to create A – Z List with pictures?
- wp_enqueue_script() with unknown path and maybe symlink
- Output HTML Tags In Gutenberg Block
- Using WP_PLUGIN_DIR for include file
- Include another HTML file in a HTML file
- Objective Best Practices for Plugin Development? [closed]
- add_menu_page() with different name for first submenu item
- Autoloading & Namespaces in WordPress Plugins & Themes: Can it Work?
- How to include PHP files in plugins the correct way
- How can I add an image upload field directly to a custom write panel?
- A tool to analyze rewrite rules? [closed]
- Difference Between Filter and Action Hooks?
- framework for plugin/theme options panel? [closed]
- Creating a table in the admin-style?
- How can you check if you are in a particular page in the WP Admin section? For example how can I check if I am in the Users > Your Profile page?
- Settings API with arrays example
- How to make a plugin require another plugin?
- ajaxurl not defined on front end
- What process do you use for WordPress development? [closed]
- What’s the difference between term_id and term_taxonomy_id
- Should I use wpdb prepare?
- Why does WordPress use outdated jQuery v1.12.4?
- Post meta vs separate database tables
- Is there any plugin development framework
- Is it possible to reuse wp.media.editor Modal for dialogs other than media
- How to add a javascript snippet to the footer that requires jQuery
- Enhance Media Manager for Gallery
- How do I create a custom role capability?
- How do I add CSS options to my plugin without using inline styles?
- How do i best handle custom plugin page actions?
- Adding Custom Text Patterns in the WP 4.5 Visual Editor
- Automatically determine minimum WordPress version required for a plugin?
- What is the advantage of using wp_mail?
- How to make a WordPress plugin translation ready?
- How many times will this code run? (or, how rich is grandma?)
- How to create an API for my plugin?
- Is it ever okay to include inline CSS in plugins?
- Plugins in symlinked directories?
- How to override existing plugin action with new action
- How to include a file using get_template_part() in a plugin?
- Add custom TinyMCE 4 Button, Usable since WordPress 3.9-beta1
- How to store username and password to API in wordpress option DB?
- body_class hook for admin pages
- “Error: Options Page Not Found” on Settings Page Submission for an OOP Plugin
- Is it mandatory to use $wpdb->prefix in custom tables
- Which hook should be used to add an action containing a redirect?
- add_action hook for completely new post?
- Why does WordPress add 0 (zero) to an Ajax response?
- What should I use instead of WP_CONTENT_DIR and WP_PLUGIN_DIR?
- How to enqueue JavaScripts in a plugin
- In Which Contexts are Plugins Responsible for Data Validation/Sanitization?
- Plugin Form Submission Best Practice
- How to redirect to settings page once the plugin is activated?
- Is get_option function cached?
- Should Plugin Folders Include a Blank index.php File?
- Unit testing for plugin development
- Methods of Integrating Plugin Data with Themes
- What is the wordpress wp-includes folder for?
- WordPress Update Plugin Hook/Action? Since 3.9
- How to include jQuery and JavaScript files correctly?
- How come `wp_options` table does not have an index on `autoload`?
- PHP error with shortcode handler from a class
- Update Option Stored in Multi-Dimensional Array
- check if Gutenberg is currently in use
- Best way to abort plugin in case of insufficient PHP version?
- WordPress Plugin Development – Headers Already Sent Message
- WP 3.3 How to Add Menu Items to the Admin Bar?
- dbDelta not creating tables
- Custom Widget function in Plugin not working?
- Passing arguments to a admin menu page callback?