In,
Dashboard -> Settings -> Media
You can uncheck the,
☑ Organize my uploads into month- and year-based folders
…and optionally change the path uploads (but this would effect all uploads of course).
Optionally you can hook onto the upload_dir
filter and change the upload path for a given post_type
, or for some other given scenario depending upon where and under what condition you are making these uploads.
add_filter( 'upload_dir', 'css_upload_dir' );
function css_upload_dir(){
global $post;
$post_id = $post->ID;
$upload = wp_upload_dir();
if( "post_type" == get_post_type($post_id) ){
$custom_dir="/skins/custom-skin/images";
$upload['path'] = $upload['basedir'] . $custom_dir;
$upload['url'] = $upload['baseurl'] . $custom_dir;
return $upload;
}
}
That should work, though I’ve not tested it, so I’m going off the top my head at the moment.
Related Posts:
- How to force Media manager to overwrite files of same name?
- How can I stop WP media uploader from creating duplicates of my uploaded images?
- Get attachments by user
- Adding wp_enqueue_media(); causes problem
- Redirect to another page using contact form 7? [closed]
- wp.media issue with selected image
- WordPress uploads do not show up and I see the white screen of death in some cases
- How important is it to enqueue a theme’s stylesheet?
- Solutions for generating dynamic javascript / CSS
- Enqueue a stylesheet for login page and make it appear in head element
- Import media to online WordPress from local development
- Generating CSS Files Dynamically Using PHP Scripts?
- Enqueue Stylesheets After Theme’s “rtl.css”
- Understanding wp_add_inline_style
- Any alternate TinyMCE4 themes / subthemes?
- Hide a div that is part of all pages on one specific page
- Why I can’t add a CSS style in this WordPress theme?
- Can’t get staging site to display same way as live site. Completely stumped
- Editing the custom background CSS
- add generated stylesheet from parent theme after child-themes style.css
- How to Handle CSS for Multiple Header header.php Files?
- Plugging into the Media Library to upload images (NOT associated with any post)
- Convert a static website to a WordPress theme and import all existing content
- Custom CSS In Uploads Folder
- There’s an image named g.gif somewhere in my WordPress site
- How to highlight the current page in the nav menu?
- Root Sage theme styles are not working!
- How to regenerate thumbnails when they’re stored on S3
- Whats the safest way to output custom JavaScript and Css code entered by the admin in the Theme Settings?
- Modify the Additional CSS section (adding a disclaimer)
- How can one update a theme on a live site without interruption?
- Sub folder CSS that’s read by Admin panel
- CSS won’t style output of wp_nav_menu() correctly
- How to upload images using Settings API
- Is it necessary to prefix every css class in a theme framework?
- Custom CSS without css.php file
- Dequeue a style file which is making website load slow!
- Do I need normalize.css when developing my own WordPress-theme?
- How to float an image in Gutenberg
- How to add a download link to a movie from WP media library?
- Attach media to multiple posts
- Customizer: Unique identifier that distinguishes which image upload control is uploading an image
- Using PIE CSS in WordPress. “localizing” styles
- How to check if a WordPress core block is active in sidebar
- Which html elements should be styled in wordpress theme
- How to override checkbox styles if these inputs have a unique id [closed]
- WordPress Media Uploader in page template (On Front-end)
- WordPress Unite Theme: Footer isn’t sticking [closed]
- How to disable wordpress from overload my stylesheet styles with customizer styles
- Combining CSS files into a single cached one
- Using page-id-{ID} from body_class() in local dev, versus live staging
- How do I remove inline style in featured image markup?
- different way to achive stylesheet_url
- How do I use a color from theme options?
- Custom image size vs CSS sizing
- Can I add an icon & function to the “Upload/Insert” toolbar at the top of the content editor?
- Why is my CSS not loading?
- Ideal inline dynamic CSS injection
- zip unzip attachments in wordpress
- JQuery undefined and Stylesheet loads in bottom along with js files
- How do I use wp_nav_menu?
- How can I wrap all blog posts image with
- theme style is applied on the dhasboard rather than the website
- White screen when attaching css to function.php
- Assign custom classes to the divs inside the loop
- SVG in list-style-image breaks when adding fill
- WordPress theme resource won’t load over VPN
- CSS added through customizer neglects the need of a child theme?
- WordPress creating images if uploaded image is greater than 960px on one side?
- A post with a clear:both in its css destroy the theme design, and the sidebar is moved to the bottom
- multiple html/css files for wordpress theme?
- Using the media library for theme customization
- How to create a WP theme that use BootStrap? [closed]
- header, stylesheet not being read
- HTTP Error when uploading images over specific dimensions
- Tiny MCE custom styles, and preview in the backend
- .current_page_ancestor broken in Twenty Eleven
- WordPress Animation Adjustments
- Is there a list of default generated Gutenberg block CSS? Unable to align video blocks
- How do I change the color of individual page titles in WordPress?
- Find the source file causing a Mixed Content warning
- How to reduce the vertical space above and below a ul list uniformly with one command?
- Is there a way to add classes to a page when using a Gutenberg reusable block as page layout?
- How can I fix my theme header for my CSS stylesheet?
- How to make the media library searchable by image title
- WordPress doesn’t load css, image and js files after moving local installation folder
- Load multiple css simultaneously using functions.php
- Necessary css classes to be included in theme stylesheet
- Images use & location, on new wordpress theme
- Mobile view logo background colour in wordpress
- WordPress Customization API overwrite LESS variable
- Alternating CSS classes for dynamic content [closed]
- How to reuse parts of WordPress site e.g. header, footer, part of header for multiple WordPress sites?
- Setting different CSS for all pages except home.php
- How do I middle-align my header menu items in WordPress [closed]
- How customizable is a self-hosted WordPress blog compared to a Blogger blog?
- Detect custom font size
- HTML to WORDPRESS [closed]
- Custom Theme functions.php – Using add_settings_field and input type=”file” to set custom logo
- Image and font support missing in editor when deploying theme remotely