I think it depends on whether you want it to be unique for each of the four “highlighted” project columns on the homepage, or whether you want each “highlighted project” to be different.
Does that make sense?
E.g. if you just want each of the four project “columns” on the homepage to look different then I’d use CSS to achieve this : nth-of-type perhaps.
But if you wanted Project A (when highlighted on the homepage) to have a unique background colour regardless of what column it appears in, then Id use PHP to add the post->ID as a class in addition to portfolio-item and then use CSS to style that.
Related Posts:
- Want to create Child theme, but already edited Parent theme css files and some php files
- proper way to add css using functions.php?
- How to put search bar & logo in the “primary navigation” storefront theme?
- The style.php file inside theme-engine folder has other content on FTP
- How to add Open/Close Toggle button into Twenty Fifteen theme for hiding left sidebar?
- user update profile for custom code
- Custom Theme, Editor won’t wrap text (i.e. change width)
- How to create and add js and css file when server is not on my PC?
- Predefine Magazine Style Layouts
- Using Featured Image as Hero Background in Word Press
- the_author_posts_link css class
- WordPress Shortcode and Dynamic CSS
- Design view breaking on Pages
- wp enqueue style and style sheet depth
- CSS saved & enqueued, but wordpress doesn’t load css text, only file
- WordPress loop specific thumbnail size
- Is it possible to use the featured image of a page as a css background without inlining?
- How to display a value from a radio button in the options menu in wordpress
- WordPress override bloginfo variable
- Shortcode content output but not in correct place
- An unwanted inline style is added to my body tag
- Add a custom stylesheet for BlackBerry
- Get different images for mobile and desktop with php, advanced custom fields without using js and ajax
- How to stop featured image thumbnail [set as background image] on blog index page just repeating same image across all posts
- Where in PHP do I move title and meta (date) to bottom of each blog section?
- Selectbox in admin panel function linking to CSS
- Using if/else statements with output from theme options
- Is there CSS to expand the gallery limit on Index Pages?
- Reconfiguring WordPress site
- Customizer: active_callback and sanitize_callback incompatibility?
- How to display pictures from database?
- Different post styles depending on category
- two columns of posts on homepage, one of them “favorites”
- custom css for admin only
- responsive.css in the WordPress should be prioritized
- WordPress style.css not updating, only after theme reload
- Adding logo to WordPress header
- Thumbnails appear to be zoomed
- Odd / Even posts add class minus first post
- WordPress Customizer Default Image
- WordPress archive page showing 404 Error [duplicate]
- Why in my theme I can’t see all the statics content under the posts?
- How to add drag and drop functionalities to a div inside option panel
- Removing WordPress Footer -without access to PHP code?
- How to add the sidebar to all the pages except the home page? [closed]
- Header not properly displaying on archive.php
- CSS change in woo commerce Place Order Text [closed]
- How Do I Find & Remove H1 From Site-Title-Wrapper? [closed]
- Post repeated when opening in overlay, how do I solve this? [closed]
- Add New Text Box To WordPress Twenty Seventeen Header
- Split site title and apply different classes
- Problems clearing cache
- Twentyfifteen style author comment
- Extend Menu Walker Output
- Randomize Color Scheme Selection in Theme
- Dynamic CSS through PHP issue
- How to correctly load a different version of main menu based on the user language in WordPress? Is it a good solution?
- How to make changes to style.php [closed]
- conditional: if is page, and all subpages
- Commas in Tag Cloud
- uncaught TypeError: Cannot read properties of null (reading ‘classList’) custom plugin
- Create Columns with Custom Walker and CSS Classes
- error_log PHP error log found. This file must not be in the production version of the theme. (wordpress theme check plugin)
- I am having issue in divi woocomerce checkout module. (DIVI theme)
- Why would the child theme load in the Customize preview, but not on the site itself?
- Styling a category link
- How to make only the valid active page of a multilevel menu active with – “.nav li.current-menu-item a”?
- echo cutom css code to WordPress page template file ? is this safe?
- Not able to remove caption shortcode from the content
- File from parent theme imported to child theme doesn’t work – any ideas?
- I can’t go to the page archive-{post_type}.php
- Problem with displaying CSS Stylesheets – Am I adding them correctly in my wordpress child theme?
- Trying to generate a CSS file in wordpress uploads folder
- WP Website is shown in HTML
- Display post date also if the date it’s the same for each post
- Invalid Argument foreach
- I got big white screen when i attach main style sheet of Html in functions.php
- register dependency css and js inside a plugin class
- Add a default style if no Featured image is selected
- Styling a specific post after hovering over it
- custom field – changing an element or background of id div – different versions not working
- CSS loading as empty file in Custom Theme
- How limit the width of a fixed menu-bar on scroll?
- Where to find the html for WordPress site? [closed]
- Two theme locations for two menus, but only one is showing up
- How to remove image on single product and get product to span page?
- widget: input the px value from user and use it as inline style in widget function
- How Can I Center the Logo in the Navigation Menu? [closed]
- How to change the menu color
- .htaccess on multisite and roots theme?
- Move wordpress sidebar on homepage up to new position
- Converting Menu Links to List Elements
- Catchable fatal error in appcloud free theme by Tokokoo
- How to get shared CSS body class between translated WPML pages [closed]
- which php or css file has generated an inline style in WordPress that overwrites my css
- Need help with Deprecated: Non-static error when update PHP 7.4 -> 8.1 with Dyad 2 theme
- how to display custom taxonomies in front page
- WooCommerce Checkout Cart [closed]
- a problem in class in class-wp-hook.php
- why css file not link?how to create permalink?