1 – it’s up to you and subject to opinion, so not best suited to WPSE.
2 – Never hardcode paths. WP has whole range of functions for finding file paths and URLS. plugins_url()
will get you the full URL to the plugins directory, handling whether you are using http or https and canonicalising the domain name for you. It will take parameters for a file relative to your plugin’s directory by using PHP’s magic __FILE__
constant too: plugins_url( 'images/plugin_icon.png', __FILE__ )
for example.
Similarly, plugin_dir_path( __FILE__ )
within a plugin file will get the full system file path to the file.
Related Posts:
- What is better way to use Bootstrap inside admin panel?
- Twenty-seventy theme remove additional CSS from head
- How do I add CSS options to my plugin without using inline styles?
- Is it ever okay to include inline CSS in plugins?
- How to add sub-menu to a menu generated by wp_nav_menu by using plugin
- How to prevent loading of all plugin’s resources?
- What is the best way to provide plugin users with a way to customized the styles
- wp_enqueue_style built in styles
- Backslashes being stripped from CSS
- Dequeue theme stylesheets but keep widget styling on custom page template
- How to check if a stylesheet is already loaded?
- how to include javascript file and css file in wordpress
- How can I add a CSS rule to edit.php?
- Remove Internal Style Sheet if no Value Provided?
- How do I include background images in my stylesheets in a plugin?
- What parameter should I pass to wp_enqueue_style to depend on the themes stylesheet?
- Is there no admin ui guide for 4.x?
- Correct check for any admin page with editor
- how to add stylesheet to particular plugin only?
- How to remove default style of header in wordpress metabox
- CSS not affecting widget output
- How can I avoid conflicts between plugin and theme?
- Plugin Development/ Stop CSS clashes.
- Can’t change the style of a submit input type? [closed]
- Make a plugin page out of influence of the theme’s style
- My stylesheets are not enqueuing
- Custom Plugin – CSS works, JS doesn’t
- Are there any official or unofficial guidelines for the styling of a widget?
- Proper way to include stylesheet for panels
- Apply styles to blockquote element with the WYSIWYG editor
- Styles don’t load correctly. Insecure content
- Completely isolate a plugin view so it doesn’t load the theme
- Is it possible to load the css just on my plugin admin page?
- Enqueue a file that’s not js or css
- Does WordPress default CSS have Grids?
- How to insert HTML/CSS/JS into my iframe plugin?
- How To Protect Plugin Display From Being Affected By Theme’s CSS
- Load stylesheet in edit category page?
- CSS not being applied using wp_enqueue_style
- WordPress Plugin Authoring question about jquery and css
- How to add some basic inline CSS using existing plugin or theme?
- Why my theme’s css not working on another site
- WordPress plugin development theme issue
- Why does theme’s reset CSS have higher precedence of plugin’s CSS?
- How to customize the size of Featured Images or Post Thumbnails in WordPress?
- Publish, Save Draft and Preview buttons do not work after being moved with jQuery
- Unable to link CSS file
- How can I add the Post ID to Class Name in Jquery?
- Let user override plugin CSS
- Best practice to include custom user styles in widgets
- How to create A – Z List with pictures?
- how to add contact form 7 shortcode in javascript variable
- Where to store PHP files created by plugin / themes
- WordPress 4.5 deprecated get_currentuserinfo()
- How to control output of custom post type without modifying theme?
- Admin config screen without menu
- What is the added “complexity” of custom tables?
- Why does preg_replace_callback never fire in this function?
- WordPress select dropdown list in widget
- Call to undefined function get_blog_option()
- Unable to get content from $post on first publish
- Broken markup when using the_excerpt() in a widget?
- Best Practices for Creating and Handling Forms with Plugins?
- Gutenberg Block add element in the Editor inside InnerBlocks after div – editor-block-list
- How do you render_callback for register_block_type to a method in another class?
- Get the password key when using the wp_new_user_notification_email filter
- WordPress API have Plugin Anti-piracy feature?
- Customizer: widget-synced triggers twice
- Plugin Repo: Why do some plugins get version charts while others don’t?
- maintaing consistent layout wordpress dashboard
- .mo translation strings not loading in PHP scripts that handle AJAX calls
- user_register not triggering with email verification
- Why is the WordPress taxonomy not registering?
- Checking for existence of a page by title?
- Adding admin menus to wordpress
- How do I change the image from the default mysteryman in the WP Profile page
- WordPress: How to rename the main php plugin base file?
- Filter for admin (back end) ‘reply to’ comment
- Is there any way to hide page from dashboard (all pages list) OR navbar from plugin function?
- WordPress database error: [Query was empty] – using $wpdb->prepare()
- Showing results from json-string in WordPress search results page
- How to revive (or take over) a plugin?
- Make visible page only in the trash
- Reading plugin settings in esnext wordpress block
- Plugin frontend page design irrespective of the theme used
- add_meta_box does not display meta box in Admin
- How to store in the database directly the translation?
- What is the “best” way to update a theme via a plugin?
- Is there a an option to modify the post content directly on the browser instead of having it reflected on browser by modifying in the database?
- Acessing WP functions in form submission handler
- Custom theme and plugin updating
- Error on using __FILE__ for add_menu_page() Function
- Getting error of unexpected output during activation
- An adiitional function fires on my AJAX submit
- Projectmanager Internal Link Code Location
- How to add something after a function
- how many rupee or dollar charge to client to make theme [closed]
- How will i add an option under customizer the event calendar section?
- Return custom product in ajax call loop
- How to create a “Most Popular” & “Latest” TAB in WordPress