For modifying the main query, I think it is best to take advantage of the pre_get_posts
action.
When using pre_get_posts
the $query
variable is passed “by reference” which means we can directly manipulate the $query
object with the shortcut functions such as set_query_var
. Remove the query code from your taxonomy template, and try the following in your functions.php:
function wpa_66609( $query ) {
if ( is_tax('clipuri') && is_main_query() ) {
set_query_var( 'post_type', array('post','clip' ) );
}
}
add_action( 'pre_get_posts', 'wpa_66609' );
If that doesn’t work, I’ll try to debug it.
Related Posts:
- Permanently remove first image from posts
- Why am I getting a different filename? And how does WordPress load singular.php for both Page & Post? (Fresh WordPress installation)
- WordPress Theme variables scope
- why is translation not working on theme?
- How to export/import theme customizer settings?
- Check php version before theme activation
- Display posts by month
- Custom SQL query to get List of posts with featured image url
- How to get the registered sidebar’s name by its id?
- One button to change all settings in theme customizer?
- Activate different theme for temporary preview
- get_the_content if it contains multiple lines it results in SyntaxError
- Looking to exclude blog posts from category Previous/Next buttons
- Nice scroll to wordpress
- Twitter feed is showing blank in WP site [closed]
- Automatic Excerpt Not Working
- How do I hardcode a WordPress shortcode into my theme?
- Using a javascript file to access a get posts array
- How is WordPress manipulating the posts like there are folders?
- How do themes render caption texts in extended markup (e.g. “wp-caption” paragraphs)
- Trying to make php run in a post
- Remove posts after a given amount of time
- Hide wordpress field if data is empty in post!
- How to show part of the_content?
- Getting error when trying to implement site-wide breadcrumbs in Twentytwentyone Theme [closed]
- How to set a min number of words for a blog post
- Get post id in a function when edit/add a post
- Reconfiguring WordPress site
- Which hook/action will help me solve my problem?
- Loading index.php contents which located outside blog folder for post single page
- get post content of particular post by url
- Get children post mime type using parent post_ID wp_post
- How to change theme programmatically from a external application?
- Separation of presentation and code – WordPress
- How to avoid duplicates when creating recent network posts
- Update post title from external file?
- get_template_directory adding FTP root folders in urls
- set post limit at load more ajax wordpress
- Design with Elementor and code the rest?
- Array to string conversion on array_map
- Only show first image in foreach loop
- How to use mysql LIKE with wpdb?
- Do I need to edit my theme in order to change the title of my blog page?
- blank white page when post/update/change option etc
- Incrementing PHP variable onclick to display posts by month
- How to Update an old theme for the latest wordpress version
- Do not duplicate posts with multiple categories in multiple loops
- show recent posts php code error?
- Post to WordPress from another Server via PHP
- Implementing custom tag/tax pages
- WordPress Search
- Update value of a associative array with update_post_meta
- Why in this WordPress theme I can’t see the Main Menu?
- Displaying Slider in Front Page (home) using Customizr Theme
- call a string/function from database
- Edit and delete permissions pages and posts
- How do I use an iFrame for my header in WordPress twenty seventeen?
- Filter wordpress posts without searching the keywords in the post content
- Post form – AJAX won’t upload featured image – Plugin development
- When I click for the redirect link it is showing the content of index.php instead of single_assignment_page.php
- How to use data URL in WordPress?
- wordpress email checker on domain
- posts_per_page displays only 2 posts instead of 4 posts
- How to get post titles by post ID and integrate with my code?
- Unable to retrieve get_author_posts_url
- WordPress recent post
- Need to show 7 posts from actual date
- Can I disable auto increment of WordPress Posts Database to utilize previously deleted records?
- Add the shortcodes from the enfold theme to the other theme
- How to use a PHP file to control the content of a blog post
- My blog posts section seems to be rendering the other blog posts inside the first? :/
- How to get Post sidebar & footer including html like get_the_content() which only gets content section?
- Menu to the right of screen on desktop using Bootstrap 4
- LinkedIn Share Post Button
- Get the total Author Favorited posts
- style.min.css code issue
- Beginner Developing Theme with Bootstrap – NavMenu question
- Local WordPress from Git repo, where to set document root?
- How do I generate formatted permalinks as specified in backend options?
- Setting at job with shortcode not working
- Display 6 most recent post on homepage?
- Apply filters when loading post via ajax
- Editing existing pre-created menus in PHP
- Published custom posts missing
- Insert wordpress tags below posts via functions.php
- Include a php file that is above WP installation hierarchically?
- Using existing widget code! [closed]
- WordPress Website Featured Image Replacement Issue
- doubled content
- Themes with variable width or single columns? I want to display source code
- WordPress article with 50 000 words loading slow – 100% cpu
- link to page_for_posts
- Display post of specific category on page
- Errors while Loading Most Recent Version of jQuery
- How to create a loop that will display one post and stop?
- $post->ID calls for current page, but what is the code to call for any new page created and published in WordPress?
- How to remove the intro animation which appears during the load up of some WordPress themes? [closed]
- Add multiple HTML attributes to an Elementor button
- How to use a conditional statement in a post loop but not count towards the “posts_per_page” if false
- Bulk data save in custom table