A simple approach could be to use a global array in which you will store posts that are selected in the featured query.
You could set this array in your functions.php or index.php : $featured_post_array = array();
Then in your featured.php file first call the global array somewhere in the beginning:
global $featured_post_array;
and inside the foreach loop add :
$featured_post_array[] = $post->ID;
Last in the index.php in your query arguments use the post__not_in parameter:
$query = new WP_Query( array( 'post_type' => 'post', 'post__not_in' => $featured_post_array ) );
Another way would be to ignore posts with the tag (or taxonomy) “featured” by using the tag__not_in or category__not_in parameters
Related Posts:
- Display featured products through custom loop in woocommerce on template page
- Custom Loop and Infinite Scroll
- Three different post types on homepage
- Enable infinite scroll on single.php [closed]
- How do I style the first two posts of a loop
- Latest Post Styled Different Than other Posts
- Solved – Inserting content inside the WordPress loop
- How to filter get previous post function by meta value DESC and post date DESC?
- Add specific class to featured posts
- how do i make this loop work
- How to fix pagination for custom loops?
- Why should I put if(have_posts()), is while(have_posts()) not enough?
- AJAX with loop filtering categories
- Remove the Homepage Query
- A search for ‘0’ returns results
- Loop that displays PARENT PAGE & CHILD PAGE & outputs GRANDCHILD PAGE title and content
- wp-admin redirecting to https, denying login
- wordpress loop for specific category
- Multiple posts with one loop iteration
- Query date in wordpress loop
- Transient not working for custom loops
- Display page of custom posts?
- include(locate_template) messing up the loop
- get_the_content not working in loop?
- Get link of inserted media file of post within loop
- If No Search Results, Show Posts from Alternate Search Query
- Output shows a page instead of a list of blog postings
- How to add “time” data this?
- multiple loops with pagination on the same page
- Loop through all media library images and return those where caption contains the text carousel
- Custom search form to display users only
- Multiple loops on the same page removing post tags
- Pages inside a page (with thumbnails)
- How to make post content from each post display within the same div
- Displaying the last page of posts
- How to order posts by meta_value created inside loop?
- How to get_posts where ‘menu_order’ is more than 0/zero?
- WordPress Redirects on Install
- How to load all pages into one page with their templates
- Problems with loop
- Repeating Loop on my Posts Page
- Shortcode with a foreach and arguments
- Detect if current page is front page within custom query
- Display Authors in a grid loop
- Infinite Scroll and DFP
- Blog’s post count cause irratic behavior
- Sanitize Custom Field Value in Meta Query
- Get Page content to displayin Bootstrap Modal
- Pagination – works on local but not live dev!
- need help looping add_action in wp
- Combine the results of two loops [closed]
- How to show more random posts if Tag has less than 3 posts
- How to display pending posts on the homepage only for editors
- How can I improve the performance of this query_posts loop?
- Distribute Gallery Images Every nth in Loop
- WordPress Image Slider Looping Title Not Working
- Is there any good reason for two CSS files to @import each other?
- Adding div after every two post on main loop! Why will first post not get counted?
- Second Loop Showing Only One Post on Single Post Page
- Pulling in featured image into default recent posts widget
- Random post link generator messes up the loop
- how can i order the category by date
- Change position of entry title
- Print the whole page?
- excerpt not showing up
- Announces with different formatting dependently on a number
- Override orderby to create list of users by custom meta_value
- Loop info in jquery Tabs – loop into a variable?
- Several loops in sidebar issues
- List page is showing 404
- Duplicated tag in loop
- Insert content above an embedded video inside Wordress’ php the_content
- Loop only shows first two posts
- Why is my archive page looping through all but one post?
- Loop two different category WP_Query
- Use ACF Category Image for all Taxonomy Archive Views
- Loop with custom posts, to include information from different custom post type
- the loop printing post in one grid
- Check value of post meta within IF statement
- Transient not working for external data
- adding tax_query to $query_string
- Get Sticky User in user loop based on user role
- Remove posts_orderby filter then add it back in
- the_title() Returns the page title instead of the post
- How do I aproach this?(for sale, for lease, sold->move something from a category to another)
- How to fix pagination for custom loops?
- Display latest posts using WP Loop with different size divs
- Combining external feed into post loop
- Loop to get current parent page “content” and his children content
- Add Div IDs dynamically to CSS
- Displaying posts limit: can’t get pagination to display [duplicate]
- Please help me to win the battle with 2 column loop by category
- Display content from “About Us” page on the Home Page
- How to use add_action(“wpcf7_before_send_mail” outside wp loop?
- Applying a filter to multiple loops for days ago
- repeating posts on 2nd page to posts
- Limitless amount of posts in custom archive page
- Two loops in CPT archive page, exclude posts from main query
- Landing page with login
- How can I create an entirely new, separate display of posts?