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)
- How to update custom fields using the wp_insert_post() function?
- WordPress Theme variables scope
- Disable Attachment Pages Completely
- esc_attr() right way and use
- Inject post (from specific category) between posts in Loop
- why is translation not working on theme?
- Is having multiple theme customizers for different pages possible?
- Remove option to allow trackbacks/pingbacks from post page options
- How to export/import theme customizer settings?
- Check php version before theme activation
- Separate WordPress themes for each category page
- Display posts by month
- Custom SQL query to get List of posts with featured image url
- Detection of theme being used
- Alter query on edit.php
- reason of splitting theme files to multiple files
- How can I remove “Proudly powered by WordPress” from twentyeleven without modifying footer.php?
- How to get the registered sidebar’s name by its id?
- How to get year, month and hour in WordPress?
- Set the transport of the Customizer ‘header_image’ core setting to ‘postMessage’
- One button to change all settings in theme customizer?
- Handling error states with admin_post
- Replacing mysql_real_escape_string in WordPress theme
- The best way to customize “nav-menu-template.php” to add if the ‘link_before’ is “checkbox”
- 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]
- Design view breaking on Pages
- Insert code when users come from an specific referer
- Handling an Ajax form submit
- Can’t Find a Way to Edit the Home Page Content [closed]
- Automatic Excerpt Not Working
- How to display related posts from parent category
- Disable External Pingacks on WordPress Posts and Only Allow ‘Self Pings’
- How do I hardcode a WordPress shortcode into my theme?
- Use different javascript files for each page on website
- Fatal error: Call to undefined function wpsc_cart_item_count()
- Using a javascript file to access a get posts array
- How to get custom image size for image uploaded in Customizer
- Passing array in add_option()
- Go to / Scroll to Password Field on WordPress Posts After Submit With Message(s)
- Widgets not showing in my custom theme
- New Plugin Review
- Make custom field meta not display if there is not data in it
- Want to create Child theme, but already edited Parent theme css files and some php files
- Print number of post (in reverse)
- Use template for posts with a particular category grandparent
- Count number of published posts by type
- WP Insert Post function – Insert Post Thumbnail
- Adding code to child theme functions.php to override parent theme behaviour doesn’t work
- Create a quick start wordpress installation [closed]
- Automatically generate Post/Page from searched Database item?
- How to migrate the posts from an old custom legacy blog to a new WordPress website?
- How is WordPress manipulating the posts like there are folders?
- How should I best target dynamically served content?
- Get_the_author doesn’t return author name
- Styling images coming from another blog
- How the functions in WP are called in tags
- Get taxonomy terms only of the WP_Query current posts
- Exclude posts from homepage having a specified tag
- How do themes render caption texts in extended markup (e.g. “wp-caption” paragraphs)
- Add a Second Menu to a theme that only support 1 menu
- Changing the template hierarchy
- How to Insert Shortcodes into Theme?
- Warning: Use of undefined constant HTTP_USER_AGENT – assumed ‘HTTP_USER_AGENT’ (this will throw an Error in a future version of PHP)
- How to get 2 or multiple custom post types in wordpress functions.php
- “before delete post” action fire when the post is updated?
- Can’t load WP function into external function
- Displaying a button on each post
- Trying to make php run in a post
- Hide post if matches current month and year
- Creating bulk posts with Youtube videos
- Set WordPress Default Template
- Remove posts after a given amount of time
- Automatically add custom CSS to new posts using a category template
- How Display Posts on category
- Hide wordpress field if data is empty in post!
- How can I use wp_query to show all product data using just the products ID?
- Query all posts of a custom taxonomy term
- Retrieving Author ID in wp-admin area
- Custom Theme, Custom shortcode not working
- Customizer: Output default value in Customizer CSS
- WordPress does not load page.php, return 404.php
- Getting a specific post values to another div or modal
- Trying to add attribute to my posts’ featured image
- Displaying the last post on static homepage
- Can’t get wp_insert_post to work
- Why not yield/iterable in posts interface?
- Adding custom directory and PHP files in wordpress
- Best practice for migration friendly images in posts/pages?
- Where in PHP do I move title and meta (date) to bottom of each blog section?
- Show full posts in archive
- How to show part of the_content?
- WordPress add post format support not working
- WordPress: Access a plugin from within a theme
- Unreadable pagination