assuming you’re using post_class()
:
add_filter('post_class', function($classes){
global $wp_query;
if(($wp_query->current_post + 1) == $wp_query->post_count)
$classes[] = 'last';
return $classes;
});
Related Posts:
- Dynamic sidebar nav with current page highlighting
- How to add tags (custom taxonomy) to post class css?
- Grid post page on WordPress with Bootstrap, the_excerpt(); Problem
- Using PHP Increment and Conditional Statement to Alternate Loop Background
- Posts are not rendering perfectly [closed]
- How to separate each individual blog post?
- Having Trouble Styling a Table in a WordPress Post
- Google yolo one tab signup plugin avilable in wordpress? [closed]
- Import Instagram post to WordPress blog post
- CSS – Initial HTML Margin Issue On WordPress Site
- Loop doesn’t show title of second post and posts thereafter
- Cannot set property ‘className’ of null at setThemeFromCookie
- How can I remove the ::after CSS selector which is automaticaly appended to the_content()?
- Make CSS Changes To Only Affect Mobile Browser [closed]
- Hover colour spreading out beyond submit button
- How to fix this error? [closed]
- Disable File Editing function
- Background image reversed on pages after home page [closed]
- Change all author links in Blog roll
- Header background image just stopped working
- Keeping CSS model open after form submission
- Sidebar button click redirect when user is not logged in instead displays it
- Some Text of website page on Iphone Safari become invisible
- Adding Custom css file
- Showing categories and subcategories with posts
- How to get an unique identifier for a page/post/category/tag etc.?
- Page layout is broken when viewing search results.
- Second get_permalink inside loop points to wrong URL
- Child Theme CSS not showing at all
- Get the amount of posts on a current page
- Loop parent terms {display posts} AND loop child terms {display posts}
- Advanced: understanding wp_add_inline_style function
- How to add a class to each individual post?
- Using transient for dynamic css , how to name it?
- Can I add generic numbering HTML classes to items as a loop runs?
- Get post format and use it as a CSS class in different spans
- How to create an optionally available stylesheet for visually impared users?
- Hide Image On WordPress On Single Page [closed]
- Image getting out of container [closed]
- Is there a way to add additional CSS styles to the styles css file dynamically?
- Is it safe to use WordPress generated classes?
- Faster fonts on mobile
- Is there any good reason for two CSS files to @import each other?
- Changing blog style [closed]
- add bootstrap post slider with tabs
- Target h1 on single post page [closed]
- Clients website shows blank page [closed]
- wp_enqueue_scripts and CSS
- How to avoid duplicates when creating recent network posts
- Why won’t my custom login page CSS load?
- Reduce white space in twenty fourteen
- Can not find css directory in header
- Every second post different class in blog view
- How to add add more properties to WP_Post object in search results loop
- How to make WordPress using local CSS/Fonts/Scripts only
- How do I use inline styling with WordPress?
- Custom taxonomy archive page problem
- WordPress address URL and bloginfo
- User gets access denied to css files and js files even though user is logged in [closed]
- CSS styling of native (inbuilt) wordpress thumbnails [closed]
- Make a vertical dynamic list of posts in alphabetically order and in columns [closed]
- What file have I to create in my custom WordPress theme to show all the post belonging to a specific category?
- HTML email sent with wp_mail shows plain text
- post_class not working with css
- Can’t call custom css in style.php
- Adding CSS to Blog Posts?
- Where do I go to change the position of the style.css?
- something strange is happening to my code
- Style file inclusion
- WordPress code editor messed up my code!
- Loop don’t work within single.php page
- Use Click Image to Play Youtube Video in a WordPress Loop
- How to make different custom post layouts?
- Using post_class to style posts indivdually
- Ordering stylesheet above using functions.php
- Display Something in the Header After All Styles are Loaded
- older blog posts not showing in new theme
- Is there any way to stylize articles one by one?
- How to get posts published on the latest date?
- The_excerpt() doesn’t parse – how to change that?
- How to Make infinite loop of post
- Trying to edit archive.php to only show post extract, with featured image
- Font shows up as Arial instead of Times [closed]
- custom header navigation has odd spacing [closed]
- Add Blog to WP homepage Manually
- How can I remove the first two words and shorten get_the_title()
- WP_Query with custom post type ID
- How to only publish posts with image in it
- Search Bar in Thesis WordPress Site
- How to know which order WordPress places CSS files?
- How to show all posts by author on buddypress profile with navigation
- Page and post loop same template
- Last class on last headline?
- jQuery UI Theme that aligns perfectly with the admin UI
- WordPress Query Posts From Category Post on Static Page
- Getting values from options page to css
- Add class to navigation link of page
- CSS – why does my sidebar drops to the bottom of the page? [closed]
- Change CSS on a wordpress post
- How to change “““ to “““?