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
- Show full posts in archive
- Dynamic Stylesheet loads but doesn’t finish
- WordPress add post format support not working
- How to add date to navigation bar
- Selectbox in admin panel function linking to CSS
- WordPress: Access a plugin from within a theme
- Can I install/embed WordPress on a ‘single page’?
- Using if/else statements with output from theme options
- Is there CSS to expand the gallery limit on Index Pages?
- Getting error when trying to implement site-wide breadcrumbs in Twentytwentyone Theme [closed]
- Connect WordPress with SharePoint [closed]
- Reconfiguring WordPress site
- adding custom user input fields in WordPress admin dashboard gives error The link you followed has expired. Please try again
- How to design a table based on css values set from admin/dashboard
- Move category description below post list in blog
- WordPress Shortcodes.. printf is outputting a random number… Can’t figure out WHY?
- Customizer: active_callback and sanitize_callback incompatibility?
- My page.php shows the index.php
- Incorrect MIME type for assets with Valet
- How to display pictures from database?
- How to add condition in wordpress loop? [closed]
- Customize position of social icons in upme plugin [closed]
- Best way to schedule daily change in CSS parameter
- Css loads very slow [closed]
- Gravity form built in Captcha
- How does wp_enqueue_scripts work?
- Different post styles depending on category
- How create a Shortcode with hover and complex options
- WordPress Multiple Navigation bars
- Compare the old get_theme_mod($name) to the new get_theme_mod($name) return value
- Custom Theme’s “Preview Changes” Doesn’t Work for Previously Published Posts
- two columns of posts on homepage, one of them “favorites”
- How do I link a button I created in theme customizer to a function?
- Auto 301 to full post permalink? (using : /archive/%post_id% to %post_name% )
- 404 error when I acess the second page of post-type
- Whats the proper way to use a php stylesheet in a wordpress theme? [duplicate]
- How to change theme programmatically from a external application?
- custom css for admin only
- responsive.css in the WordPress should be prioritized
- How do I add a custom css to all posts without affecting homepage css? [closed]
- Is the “_s” on this `sprintf(__(‘Page %s’, ‘_s’), max($paged, $page))` just refer to a text domain?
- Does wordpress templates always in files or in database?
- Which is the correct way to conditionally enqueue a CSS file?
- Custom Background by Page IDs
- WordPress style.css not updating, only after theme reload
- Adding logo to WordPress header
- Thumbnails appear to be zoomed
- Use PHP in stylesheet to specify a background image based on Category ID
- Automatically set all tags to have a height of 0 if there is no content inside the tag [closed]
- height should be set to auto to avoid pixelation in the post thumbnail function
- Odd / Even posts add class minus first post
- Change CSS based on is_user_logged_in
- What does this mean in wordpress? Easy question
- Showing latest post without 301 redirect
- RTL Stylesheet Confusion with WordPress
- Translate wordpress date from Italian to English
- Why am I getting a different filename? And how does WordPress load singular.php for both Page & Post? (Fresh WordPress installation)
- Correct way to enqueue page specific CSS file
- Wrapping a Sidebar within
- Add Codepen animation as Preloader to WordPress
- Reason to add a name of the theme like (‘menu-1’ => __( ‘Primary’, ‘twentynineteen’ ),) in PHP?
- Separation of presentation and code – WordPress
- WordPress wp_add_inline_style unable to give hex colors?
- Reduce size of responsive title
- How to make container class in PHP
- How to create table in wordpress without plugin? [closed]
- WordPress Customizer Default Image
- WordPress archive page showing 404 Error [duplicate]
- Do I have anything to worry about when switching to a default theme to test for plugin conflictions?
- PHP in CSS file?
- Why in my theme I can’t see all the statics content under the posts?
- get_template_directory adding FTP root folders in urls
- How to integrate noimage picture in this code
- Clickable image link sends people to wrong URL
- Styling the second sidebar
- Add class to DIV depending on page loaded
- Need oop for wordpress theme? [duplicate]
- Liking a facebook page from wordpress website?
- trouble with page_id & highlighting current page
- Last class on last headline?
- Creating a blog on my companies new website using WordPress but I have sidebar issues
- Creating a mobile site by adding a new class to the body tag from functions.php
- wordpress admin plugin menu custom css
- How to add drag and drop functionalities to a div inside option panel
- Removing WordPress Footer -without access to PHP code?
- Change “No Comments” link to “My String” on Blog Post (Find Snippet in Code or use CSS, PHP Solution) [closed]
- How to add the sidebar to all the pages except the home page? [closed]
- Header not properly displaying on archive.php
- Save Custom CSS file in the upload folder dynamically?
- How to remove sidebar primary widget on Mobile on category page [closed]