No, its not possible. $content_width is a theme-wide constant, and its set in functions.php before any of the query conditionals are set.
$content_width is used to determine the intermediate image sizes in image_send_to_editor. The “large” image size will be set to the value of $content_width.
If you need to modify those sizes on a per-category basis, you can hook into that filter… see my answer on the question change set_post_thumbnail_size according to post type admin page for a general example of how this can be done (note that this will almost always fail if you’re trying to do it by category, as the post category is almost always not set when the user first uploads an image – setting it by post type is a little more reliable)
No matter how wide your posts and pages are, set $content_width to the widest image you want a user to include in a post.
Related Posts:
- How to hide and content from auto-generated excerpts?
- How to tell if the user is an admin?
- Remove frameborder attribute from iframes
- How to add oEmbed support to my theme?
- Responsive embed for the video shortcode
- How can I detect hierarchal relationships beyond children (grandchild, great-grandchild, etc)?
- Where do you add code in custom fuctions so it works on a specific page?
- If user is logged in and has a role echo statement
- Why is the `if else` not working?
- How do I keep my iframes responsive and scaled to fit their container?
- hide/show a div in wordpress
- Conditional loop based on current page
- Checking conditionals
- Software for WordPress Theme and Plugin Development? [closed]
- How to override pluggable function in theme?
- Should we use get_template_part() in functions files instead of include_once?
- Reset positions of metaboxes in admin
- Understanding wp_add_inline_style
- Add a new checkbox in theme options
- Can I create customizer setting that can handle plugin shortcode?
- Is it good to rename theme folder downloaded from WordPress.org?
- Get category slug and display it on a query_post
- How to get the name and description of a sidebar in theme?
- Featured Image in 4.4 should be larger on mobile device
- What is the best way to export and import theme options?
- Home page for a category / taxonomy
- How to add nofollow to wp_nav_menu
- How can you determine whether an image is merely attached or has actually been inserted into a post?
- Root Sage theme styles are not working!
- How to configure wordpress to work with Vuejs with SSR and without hashbang
- Cannot update WordPress General Settings Site Title and Tagline
- How can I disable/hide certain themes in multisite?
- Some doubts about how to show posts in a custom theme?
- Why are theme templates organized as multiple point of entry PHP files instead of reusing your theme’s index.php?
- How to add a second stylesheet to the editor
- Single Page theme [closed]
- How to create a custom template to admin dashboard
- filter “inactive” categories from wp_list_categories?
- Easy lightbox effect inside of dashboard widget
- Custom Field created in add_meta_boxes reappearing itself again in the default Custom Metabox
- Dynamically generated wordpress customizer options?
- Filter categories used with Custom Structure Permalink
- Post thumbnail to append post content via ajax click event
- Is it possible to save more than one image to an option?
- Custom WordPress File Inclusion
- Should i clear the plugin cache for cache busting?
- Wp Super Cache stops the update of a Post Meta
- WordPress 3.8 Backend Admin Color Scheme add more scheme how to do?
- How to do a section of bulleted text within our page?
- What should I use? index.php, front-page.php and home.php
- Theme thumbnail in dashboard
- How to change the theme directory uri for localhost?
- What is the diferences between pure WordPress theme and Woocommerce theme? [closed]
- featured content: which area does this cover [closed]
- How to count posts of a category and of a category limited by a tag
- Should I create multiple sidebars, or use or one dynamic sidebar with logic to determine it’s abilities?
- Insert Rich Text Editor in theme?
- Customizer: get_preview_url() inside customize_save_after hook
- How to add custom meta box when you have a custom page template file
- Password protect a custom template
- Different themes on one site
- Theme Check errors of theme code
- Allow different tags in widget titles
- Pagination and multiple loops
- Does wordpress add their own classes into nav menus?
- Post archives link yields a 404 Not Found
- Getting white screen of death on category pages because of body_class() function
- Let user to upload multiple time
- get main URL from subdirectory with php
- Is_single not working properly in genesis
- Developing WordPress site behind a static site
- Code showing in wordpress post titles around website
- register_theme_directory() sees custom themes directory, but blank frontend
- How to change parent permalink?
- how to call options on front end and add logo
- Jetpack Infinite Scroll Not Working
- After WP 4.6.1 Update , Blog page started giving 500 error
- Editable screenshot.png in a custom theme developed
- How to create multiple pages in a client theme?
- How to share posts (and plugins) between existing site and new, separate dev/test installation?
- get_theme_mod not pulling css colors into header using wp_head
- Duplicate WordPress site to subdirectory but use same db?
- Menu order of parent menu from perspective of child menu
- Theme customizer live preview JS- Trying to bind to an html image url without luck
- wp_deregister_script was called incorrectly
- Undefined index: debuging error for theme option template snippet
- Multiple Content Shortcodes
- Add the ability of changing background color of a theme [closed]
- How to use esc_attr__() function properly to translate a variable that contains string?
- What to do when child theme is out of date with parent theme
- Permalinks problem with custom theme
- Purchased Theme to Custom Made Theme? [closed]
- How to make website with many template that active [closed]
- Query for tag given slug
- Image Size wrong during upload
- Creating image grid on products page in wordpress
- Insert gutenberg blocks into template
- What is the point of using archive.php instead of index.php?
- Querying by post category slug with core/query block markup
- Get the name of the template/*html file used