You simply need the is_sticky()
conditional check and then act on that. You would probably still need the is_home()
and !is_paged()
conditional check to only target stikies on the first page of the home page
if ( have_posts() ) :
while ( have_posts() ) :
the_post();
if ( is_sticky()
&& is_home()
&& !is_paged()
) {
// Do what you need to do for stickies
} elseif ( !is_sticky() ) {
// Do something else for non-stickies
}
endwhile;
endif;
Related Posts:
- Apply styling only to first page sticky posts
- How to retrieve “sticky” post outside the “loop”?
- 3 Posts in Loop, Show Stickies First
- Move sticky posts down in main loop
- sticky post in custom loop
- Blog page Server error 500 with stick post loop in query.php
- Showing sticky posts with get_posts()
- Exclude first post (sticky or not) from the loop using query_posts()
- Loop for sticky posts
- Custom Query with Sticky Posts
- Insert/sticky multiple posts in multiple positions
- Different style for first two (sticky) posts
- I make sticky post for my archive page for custom post type with ACF field and loop is not working
- Jquery Slider for profile template
- Get excerpt using get_the_excerpt outside a loop
- Should I use loop in the single.php file?
- WP_Query: Why is sticky post not first item in loop?
- how to upload image using wp_handle_upload
- Avoiding using a loop to access a single post
- Adding ‘current_post_item’ class to current post in the loop
- wp_list_categories: get latest featured_image of category
- WordPress Alphabetical Glossary close div in loop
- Landing Page – Redirect Loop?
- How to make multiple Column in archive Page?
- Sort Popular Posts by Views for the Last Week
- Exclude filter on front page
- category__not_in — anyway to use category name instead of id?
- Filtering posts by multiple taxonomies
- Query sticky posts with thumbnails
- Exclude first 2 posts with meta_key from loop
- Make a custom loop inside single.php with pagination
- Why do I get `Call to a member function have_posts() on a non-object `? [closed]
- Help with Changing loop.php?
- Adding shortcode closing tag after a loop
- Removing the_content() from the page
- How to split a loop into two columns
- Category Ajax call
- Change front-page layout after x amount of posts ( while in the same loop)
- Transient loop issue
- popular post weekly and monthly
- How can i use the same template file with a widget and category loop?
- WordPress Loop inside Loop?
- Filter the loop by categories using checkbox form
- angularjs not displaying all posts
- query_posts() vs get_posts() multiple loops [duplicate]
- Page-loop is looping content from custom loops on the same site. How to avoid that?
- Latest Post Styled Different Than other Posts
- ACF custom field in [closed]
- Split wordpress loop to multiple layouts
- How do I make a variable available inside partials?
- Only display sticky post or latest post in custom loop
- How to order by multiple fields using standard query_posts?
- Get 1 more post in loop
- Pagination not working in category listing [duplicate]
- Make loop alphabetical
- How to check if a product is purchased within the last 365 days before displaying something
- How do I get my loop.php to properly paginate?
- Category links including all posts
- Hiding a row in the loop if empty
- How to display first post
- Pagination on custom post type on front-page.php
- get_template_part() Not Working in Loop
- get_delete_post_link() inside Loop stubbornly returns nothing
- CPT while loop not working
- Problem with Front-Page.php loading recent posts
- Comments_template doesn’t work
- Get markup for post without loading into the template
- How can this multiple loop have pagination as described?
- Where to add offset?
- How to synchronize The Loop with the max post per page?
- How to add a byline to all the pages?
- Displaying member join date on page
- Ascending order has strange effects on wordpress loop
- get post images to link to external sources
- Set depth of pages to fetch
- Trying to get all links in my posts
- Creating a User-Adjustable chart in WordPress
- How to display sticky post always at the top (before regular post) in wordpress?
- Reorder posts in a loop: have the posts by one particular author below the others
- Slug is changing when I use WP_Query in a metabox of a post
- How to execute a user loop with shortcode
- how to get author comment inside the loop?
- Custom loop not working in singular.php, working in other pages
- Loop Posts Outside of WordPress Installation
- Strange problem with wp_get_attachment_image_src database (db) query count
- How to include posts from one category, into a separate category of posts?
- how do i make this loop work
- Making a specific page wordpress compatable that is not index
- Display single post inside accordion based on form submission results
- change the_content images for different sizes (Desktop, tablet, mobile)?
- display only parent replies count in index.php
- using the loop on a page
- Eliminate duplicates in a foreach loop [closed]
- Tag custom loop show posts
- While loop inside another while loop
- loop mix my child-category and parent-category
- Fix html inside a for loop [closed]
- Display all posts in a page code for template
- Insert multiple custom components after x-number of posts
- How to get files from loop for zip