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?
- Plugin Form Submission Best Practice
- Plugin directory “Last Updated” not changed after initial commit?
- What is the recommended way to create plugin administration forms?
- Fatal error: Call to undefined function wp_mail()
- Does WordPress have an Browser Agent?
- How Do I Load My Action Earlier Enough?
- How to check WordPress website username and password is correct
- How to sync with plugins update after I have done manual optimizations?
- How to retrieve a value via get_option when the option_value is stored in a multi-dimensional array?
- Filter on the_content ignores shortcodes
- Custom theme sufficient or custom plugin neccessary for this feature set?
- Check spam in custom form – akismet
- Add Admin Menu Inside Construct or Init
- get plugin directory url
- WordPress cron running twice
- How to create thumbnail of different files?
- PHP library that can merge stylesheet with inline style [closed]
- Admin-ajax.php appending a status code to ajax response
- comment_email hook doesn’t seem to work for comment editor field
- admin_notices not displaying in plugin
- How to get color name in PanelColorSettings in custom Gutenberg block?
- Get Objects While Deleting term
- Cannot redeclare function error on the same line
- js/css updating when making a plugin
- Subscribe to author?
- Append country to ‘pretty’ url but serve same page
- Set page template programaticlly in plugin
- Adding a brand column to WooCommerce Products
- How to use output buffering in WordPress hooked functions?
- Plugin menu addition in multisite
- Mixing and Matching – Custom templates in a WordPress plugin
- Open Graph Object Debugger & url parameters – Page Not Found result
- How to get Metabox custom field to show checked if value is updated using post meta query?
- How to Move the Comments Bubble to the Right Side of the Toolbar
- How should I go about registering JavaScript that isn’t a file? [duplicate]
- Can’t find where to modify attrbitutes
- How to pull user/author profile data in a plugin?
- Adding columns to core tables
- Add Password Generator on password protected page
- WordPress pages are not published due to External database connection with WPDB class
- How to optimize multiple insert into wordpress database
- Injecting HTML on (arbitrary) admin pages
- Custom Stylesheet instead of Inline CSS for WordPress Customizer API Overrides
- How to add custom options for plugin into the add post screen – like yoast seo
- Information on plugin adding text when a post, page, or other such is displayed
- How to relate the Category to user?
- Get coordinates of selected area to use in image maps [closed]
- How to trigger selected option from a clic. (variation product woocommerce)
- why is apiFetch throwing Unhandled Promise Rejection: TypeError: Object is not a function
- how to create a shortcode from a variable in plugin
- Any way, hook to add content right before the “read more” link?
- Error Connecting to Database WHEN Installing WordPress on XAMPP [Tried All the Usual Stuff] (Pics Included)
- How do I ensure I can loop through every enqueued script and CSS?
- Adding body class in author page for custom role
- Plugins Settings page not updating
- TinyMCE 4.7.11 – Enable hidden WordPress core plugins? (referencing a wp-includes from plugin.php)
- Enqueue scripts based on site.
- My enqueue admin style function doesn’t work because of ?=ver
- Use content filter on the post that is password-protected
- WordPress filter custom posts by multi terms of of a taxonomy
- foreach argument to get specific file types getting too many returns
- Query only title/field/featured media of posts [closed]
- To remove rendering of menus and header, plugin or theme?
- How can I give access to my plugin sections in admin?
- Making plugin output customizable
- Return all roles, including custom roles
- Mapping multiple URLs to same page
- Installing plugins on installation/activation
- Loading jQuery library from WordPress admin