There are a few ways to accomplish what you are trying to do. The first and easiest thing that I think I would try is to replace your call to is_home()
with is_ftont_page()
. Read here for the difference between the two.
If that doesn’t fix your issue, you could try making a call to WP_query from within your template code. It might look something like this:
$query = new WP_query(
array(
'post_type' => array('post', 'videos'),
'post_status' => 'publish',
'order' => 'ASC'
)
);
foreach ($query->posts as $post) {
// Your display code here.
}
There are a lot of parameters that you can modify to get the query working just the way you want it. It’s all there in the documentation. If you go this route, you would want to remove the ‘pre_get_posts’ hook.
Hope this helps!
Related Posts:
- Custom Post Types and 404 Pages
- How to display user-defined / custom post in wordpress?
- 2 custom posts types, in their own columns, one pagination for both
- WordPress query in which condition uses custom field
- WordPress loop add heading before first of type
- Fetch loop of custom post types with AJAX
- Custom post types not displaying per category
- Only show current category post
- How to make a shortcode for my WP_Query Loop? [duplicate]
- Error in WP Query. If variable is empty it is displaying previous post value
- Strange behavior on WP_query
- Looping through custom taxonomy in one template
- get_post_meta for Custom Post Type ( CPT )
- WordPress loop, show only one post per custom field
- How to return custom posts in loop?
- All custom posts are not showing up
- WordPress query posts by custom post type not workng
- How to keep a CPT stick to specific position?
- How to show Y number of custom posts after every X normal posts?
- How To Loop Through list with Custom Post Types
- Custom post type with custom taxonomy permalinks
- custom post type loop
- How to Fix Custom WordPress Loop with Pagination on Single Post View?
- How to check if meta box value is false for all posts then do something based on that
- Tricky Custom post loop
- Loop posts in a table ordered by a custom field value
- Custom Homepage As Single Page or Custom Post Type?
- Is it possible to add query parameters on the archive page?
- Custom Loop Event Page
- Custom taxonomy page template
- Multiple loops for custom post type to spread data across rows
- Cant insert wrapper div into index.php
- Pagination on custom post types
- Custom Post Type + Category archive
- How to make post page unique and show it on home page?
- Pagination in custom post type page template
- Loop with Custom Post Type and Taxonomies
- How to get past and upcoming post by defining date in custom field?
- display news with pictures 3 small and one large (loop)
- Loop multiple taxonomy in custom post
- $post breaking container loop
- How to query all custom posts of a certain type and checking what category they have
- Custom post type archive pagination with HTML5Blank theme?
- Post data in separate divs with incrementing class using WP_Query
- Redirection loop error after login from a custom post type post
- How to create content automatically when a post is published?
- WordPress Custom Post Type and sort by Tags
- WordPress loop for multiple custom post types
- Load different template for CPT (in loop) in my plugin?
- Custom Post Type Order Index Loop
- After rewriting post type’s URL, the number of queries has increased dramatically
- How to loop custom post type posts by author?
- Display posts from category in page
- How can I pull information from my loop and divide them seperately?
- Multiple Queries and Loops within CPT Archive
- Posts without featured image using other post’s featured image
- WordPress nested loop not working
- Order by custom field attribute
- Get result from Custom Field in Custom Post type
- Display Custom Taxonomy of custom post type
- Pagination not working with custom loop
- Fallback if statement based on the number filtered from it
- If i have custom post type with 5 custom fields do i have to create a new loop to reference each one?
- Turn post into simple slideshow
- Sorting custom post types by taxonomy (So close)
- Inserting random posts
- Nested loop called with shortcode duplicating the content above the main loop
- Create custom post order (with custom post type meta)
- Pagination not working with custom loop
- Pagination not working with custom loop
- Pagination not working with custom loop
- Looping taxonomy in taxonomy?
- next_posts_link returns same content of 1st page
- Custom Loop and Standard Blog Loop Issue
- Listing custom post type items from a couple of custom taxonomies
- Pagination not working with custom loop
- Custom loop won’t work, can’t find problem
- Custom post-type’s pagination not working in category.php
- Pulling in a particular post into a single page based on the post id passed into the code
- Noob Loop Question
- Categories and page filtering with pre_get_posts
- Display multiple custom post type lists on homepage – multiple loops
- Loop through multiple custom taxonomy terms and display posts for a custom post type
- Custom Post Type Loop breaking php
- Styling first post using Advanced Custom Fields
- loop through custom post-type with two meta_keys
- Query Custom Post Type by Tag
- Loops running into each other
- Display by tag from different post types
- Fourth page of custom post type archive page does not exist
- Loop to pull content from parent element in custom post type [duplicate]
- Loop doesn’t work in single-product.php page but works at normal page
- Catergory args causing loop not to show
- why get_post_meta is returning 0?
- How do I filter a custom post type loop by a field?
- Post_type doesn’t work for widgets?
- the_content() stop images being pulled through
- How to filter homepage posts by popularity? [closed]
- How do I correctly query posts from a post ID?
- Get Posts From A Certain Post Type In An ID Array