This isn’t really WordPress specific, but from the server perspective it would add additional http requests for visitors to load additional css files, versus pulling the same site-wide css file from cache.
From a css perspective, I prefer to keep it all in one file. Some people prefer to organize things differently, like all text styles in one file and then layout specific stuff in another. In that case, they may keep layouts specific to certain templates separate.
For simple layout differences, I do something like:
template a:
<div id="main-content" class="full-width">
</div>
template b:
<div id="main-content" class="narrow-width">
</div>
css:
#main-content {
/* common to all content */
}
.full-width {
width:500px;
}
.narrow-width {
width:300px;
}
I keep IDs meaningful to the content, and use classes to define layout.
Related Posts:
- How to define and link full path to css located at a random folder on header.php
- How to add CSS class to custom logo?
- How to add custom css file in theme?
- How important is it to enqueue a theme’s stylesheet?
- CSS not updating in browser when I change it
- Solutions for generating dynamic javascript / CSS
- Do I actually need to link my theme’s style.css in the theme files
- Enqueue a stylesheet for login page and make it appear in head element
- How to move page template files like page-{slug}.php to a sub-directory?
- CSS classes for theme
- Generating CSS Files Dynamically Using PHP Scripts?
- Enqueue Stylesheets After Theme’s “rtl.css”
- How to move page templates to custom folder?
- Customize Option Framework
- Why I obtain different visualization when I run the website on my local machine and on remote server?
- Some doubts about WordPress handle the horizontal main menu visualization
- How to create a WP theme that use BootStrap? [closed]
- Can’t change theme name
- my single.php is mixup on some post for no reason
- How to use the _S framework
- Custom theme template files
- Is it possible to have a Theme with built-in physical page files?
- header, stylesheet not being read
- How to use shortcode inside of shortcode in theme
- Tiny MCE custom styles, and preview in the backend
- How to format the first line of a post differently?
- Trouble in creating a custom template on twentyeleven theme
- .current_page_ancestor broken in Twenty Eleven
- Custom search template is showing 404 when adding query string
- ACF get_sub_field ALT TAG in the repeater doesn’t show
- WordPress Animation Adjustments
- Is there a list of default generated Gutenberg block CSS? Unable to align video blocks
- style variations hurt the editing performance
- How to create a robust and logic class naming system in WordPress theme developing?
- Why nav_menu_css_class doesn’t work with apply_filters?
- A Reviews Page is Showing root Index.php instead of Template-Page
- How do I change the color of individual page titles in WordPress?
- No templates for condition page.php Elementor
- 3 Level Menu Navigation (3rd Level not displaying)
- Default customizer colors aren’t displayed outside of the preview
- 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?
- Show Yoast SEO meta tags in Custom WordPress Templates (Theme)
- Is there a way to add classes to a page when using a Gutenberg reusable block as page layout?
- How to show metabox on page if it is using a template
- How can I fix my theme header for my CSS stylesheet?
- How to display only the first two elements from ten same elements
- Template for front page (latest posts)
- WordPress doesn’t load css, image and js files after moving local installation folder
- How to generate a rtl.css file for themes?
- Load multiple css simultaneously using functions.php
- Necessary css classes to be included in theme stylesheet
- overlay post title over post’s featured image
- Group several custom global page templates in sub-folder
- Problem with Displaying Custom Theme Page’s Content
- Change site title color on individual pages
- Images use & location, on new wordpress theme
- Mobile view logo background colour in wordpress
- How to fix an issue with customizer live preview?
- How to show children pages as array
- Different stylesheet for different pages not working fully
- Create a variable with string, array or multiple values
- WordPress Customization API overwrite LESS variable
- Why WordPress gets old templates code instead of the last updated ones
- Can you create a custom page with content in the center already defined?
- Custom CSS no getting applied
- How can I fix the even/odd child classes comments so that the comments are unaffected by the top-level even/odd?
- editor style css and page template with and without sidebar
- Enqueue Stylesheets After Theme’s “rtl.css”
- WordPress 3.5 + Foundation 5 not working on IE9
- Why the slideshow is not shown in my theme?
- Any disadvandages if I style the wordpress align classes without img and .wp-caption prefix
- adding navigation to genesis themes
- Paginated WP_Query doesn’t return 404’s, even when posts don’t exist
- Alternating CSS classes for dynamic content [closed]
- Custom link color or stylesheets
- How to reuse parts of WordPress site e.g. header, footer, part of header for multiple WordPress sites?
- Loop inside page template not working
- Header is not showing full width
- Setting different CSS for all pages except home.php
- How do I middle-align my header menu items in WordPress [closed]
- How to resize video lightbox popup in wordpress? [closed]
- How can I get rid of the distance when I’m using list-style-type: none? [closed]
- How to highlight current menu bar base on the URL?
- What is The Best Way to Make Parallax header effect for wordpress theme ?? pure CSS or using JavaScript? [closed]
- How customizable is a self-hosted WordPress blog compared to a Blogger blog?
- Detect custom font size
- HTML to WORDPRESS [closed]
- How can i display a 4 diferent themplate for the archive page
- How to split the site’s layout without damaging this layout? [closed]
- DIV containing iframe disappears below break point of 992 in Oxygen Builder
- Is there a way to have WordPress autodetect page templates in the page-templates directory and any sub-folders?
- What is the point of using the front-page.php template? [closed]
- How to automatically set a Template Page Name next to a page in menu screen such as WooCommerce pages, front page, or posts page in wordpress?
- Align images to the left of the content
- Image and font support missing in editor when deploying theme remotely
- WordPress search field won’t get wider
- WordPress 6.4.2 – can’t load editor style css using ‘after_setup_theme’ or ‘admin_init’ actions
- Twenty Twenty-Four Theme, where to put the personalized CSS style rules?
- WordPress function::: get_header();