If you don’t know, and can’t control, the content width, then your Plugin shouldn’t assume any given content width.
Also, even though templates may be 960px in total width, the content width will almost assuredly be less than that.
If you must apply explicit width to your output, you could try returning the value set for the $content_width
global, and then use that value in your generated CSS.
Related Posts:
- 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
- What is better way to use Bootstrap inside admin panel?
- 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 remove default style of header in wordpress metabox
- CSS not affecting widget output
- How can I avoid conflicts between plugin and theme?
- Can’t change the style of a submit input type? [closed]
- Make a plugin page out of influence of the theme’s style
- Distributing Frontend Assets with Plugins
- 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
- 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?
- Twenty-seventy theme remove additional CSS from head
- 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
- Change the_title() of a page dynamically
- Adding more options to the instance of an image. (Attachment Display Settings)
- Trouble with Transient API when W3TC is activated [closed]
- Using wp_filesystem in Plugins
- WordPress REST API call generates nonce twice on every call
- Filters ‘request’ and ‘parse_query’ not firing in sites.php nor link-manager.php
- How to trap “Publish” button to check for meta box validation?
- How to use filter hook ‘post_updated_messages’ in coherence with action hook ‘save_post’
- wp_mail not recognizing cc and bcc headers
- Plugin Loading Scripts and Styles on Every Page – Even when not being used
- set_sale_price in WooCommerce [closed]
- Adding extra pages to plugin that shouldn’t appear in the sidebar
- jquery document ready function not being called [closed]
- Custom plugin icon not showing up
- I’m designing a plugin to create database indexes. Suggestions?
- Plugin for Android Marketplace downloads?
- How to export post meta with images in wordpress
- Parse form values before sending to options.php
- My WordPress plugin cannot load my JavaScript file
- Password field is empty when using wp_signon();
- Show error message after exception handled
- wp_editor add media button not working
- Plugin Development – Class Constructor Not Firing wp_enqueue_style action hook
- Alternative functions for mysql_free_result and mysql_ping in wordpress functions
- Getting a WordPress Debug Strategy
- Best way to include and use Zoho SDK in a wordpress plugin
- How to change WooCommerce loop product title HTML output in single product page and archive page
- How remove trashed WooCommerce orders from wc_get_orders() result?
- How do I get variables from my plugin’s settings page?
- Unexpected T_FUNCTION
- How to avoid conflicts with db.php / $wpdb and other plugins that decide to use them?
- Plugin can’t be activated [closed]
- Is there an action_filter hook to add content before the post title?
- Add quick edit functionnality to plugin table
- Hide / show settings field based on other field’s value
- $_SESSION inside php function executed by AJAX
- Two same AJAX calls – one is working, other doesn’t
- add pagination to wp_remote_get
- Adding and handling custom settings tab to fusion element
- How to get option values without requiring wp-load?
- Problem with baseurl and interaction with plugin
- Why setcookie function redirecting to home page in wordpress?
- Should all roles be allowed CRUD operation on the database?
- Associating special meaning with user id 0
- Downloading Generated XML File
- How to use permalink query to go to specific tabs in posts
- Conditional query tags do not work before the query is run. Before then, they always return false
- Send Webhook when post-status is publish or trash
- Is there a canonical way for a plugin to install a mu-plugin or drop-in?
- How can create a custom plugin to call my webapi after any registration or membership plugin functionality
- Calling get_header() with installed FSE theme