swhcr.com

Wordpress Custom Post Type Archive Page Not Working

Home > Custom Post > Wordpress Custom Post Type Archive Page Not Working

Wordpress Custom Post Type Archive Page Not Working

Contents

How to address friction between estimation requests and delivery commitment North by North by North by South East What does the letter 'u' mean in /dev/urandom? Chris you should update your snippet to include Jon's suggestion. asked 3 years ago viewed 2855 times active 3 years ago Blog How We Make Money at Stack Overflow: 2016 Edition Stack Overflow Podcast #94 - We Don't Care If Bret Reply ↓ Develocom Permalink to comment# November 17, 2014 I agree with Vlada. http://swhcr.com/custom-post/wordpress-custom-post-type-archive-not-working.html

Elle Permalink to comment# November 18, 2015 Thanks Ana!! Cancel Reply Job Board Twenty Over Ten is hiring a Web Designer/Developer Hart is hiring a Web Designer Oregon State University Extended Campus is hiring a UX Graphic Designer See More It is made possible through sponsorships from products and services we like. *May or may not contain any actual "CSS" or "Tricks". Here's the code I solved it with. /* Allow ht_news post type to use category template without affecting widgets ======================================================= */ function my_get_posts( $query ) { if(!is_admin()) { /* if ht_news

Wordpress Custom Post Type Archive Page Not Found

flush_rewrite_rules(false); -- this is something you need to include whenever you create a custom post type with an archive? Reply ↓ Rui Permalink to comment# October 29, 2011 Yes. Reply ↓ David Permalink to comment# January 30, 2012 Solved that problem - getting custom post types to display in an archive page - however mega menu goes blank, some images I was able to get everything working with this: function custom_post_archive($query) { if(!is_admin()) { if (!is_post_type_archive() && $query->is_archive()) $query->set( 'post_type', array('projects', 'nav_menu_item', 'post','team') ); remove_action( 'pre_get_posts', 'custom_post_archive' ); } } add_action('pre_get_posts',

Here is the snippet I came up to. Use coupon code CSSTRICKS to save 20% for the firstyear. File an edit if you need to post additional info. Custom Post Type Archive Link function_exists( 'custom_post_archive' ) ) { function custom_post_archive( $query ) { if ( $query->is_archive ) $query->set( 'post_type', array( 'villa_listings' ) ); remove_action( 'pre_get_posts', 'custom_post_archive' ); } } add_action( 'pre_get_posts', 'custom_post_archive' ); JP

Reply ↓ Adam Permalink to comment# March 28, 2014 Awesome! Only problem is my arhive.php shows only regular posts, not showing my custom post typs (same after using this code) can someone tell me where what file i must also check For example Roots –Lenin Jun 6 '13 at 18:41 try saving permalinks again in wp-admin panel –M Khalid Junaid Jun 6 '13 at 19:23 Done. This complete template hierarchy can be useful.

etc…. Wordpress Custom Post Type Category Page Not Working I feel like there has to be something basic I'm doing wrong. I know that there was a trac ticket raised for this to include index pages for this, but it was rejected. Here's a screenshot of my settings: http://i.imgur.com/6rJgdhS.png I've tried disabling/enablind it, no success.

Cpt Ui Archive Page

Seems to work well for me! Where do the white lines come from in my composite? Wordpress Custom Post Type Archive Page Not Found Also, change my taxonomies rewrite slug to courses-list . Custom Post Type Archive Not Showing Where I have been running into problems is on an archive page for a custom post type.

If you see any errors or find something better, let me know :) function some_function( $query ) { if(!is_admin()) { // For categories, lets add 'nav_menu_item' to the array so we http://swhcr.com/custom-post/wordpress-custom-post-type-url-not-working.html It worked a treat. Does any organism use both photosynthesis and respiration? I had trouble in various ways with all the rest of the code snippets above. Archive Page Not Working Wordpress

I was allowed to enter the airport terminal by showing a boarding pass for a future flight. Where is my mistake? If so, this will not work, and you will have to do a lot more than twiddle some flags in register_post_type, and introduce potentially site breaking bugs ( permalink clashes between navigate here For more information follow this link.

So maybe I'm simply mixed up with the urls. Archive For Custom Post Type share|improve this answer answered Feb 23 '13 at 21:08 Matthew Boynes 5,2391830 Thanks again Matthew. ;-) –Gab Feb 23 '13 at 21:12 add a comment| Your Answer draft North by North by North by South East The relationship between flat vector bundle and flat projective bundle Why do solar planes have many small propellers instead of fewer large ones?

Thanks :) Reply ↓ Ray1618 Permalink to comment# August 20, 2014 Jon B's & Daans solutions worked both for me, great!

Thanks Ana!!! Would this be considered as plagiarism? Word to describe object that can be physically passed through more hot questions question feed lang-php about us tour help blog chat data legal privacy policy work here advertising info mobile Custom Post Type Archive Url Please note at the end that I have set the photos custom post type to be the main loop.

Kept me searching for hours :S Reply ↓ Bart De Vuyst Permalink to comment# September 3, 2014 This snippet doesn't work with WPML. Reply ↓ Jeremy Permalink to comment# November 8, 2013 This bit of code saved my life. This site is not affiliated with the WordPress Foundation in any way. his comment is here Thanks, Mikey.

cschuster @cschuster 5 years, 5 months ago I have the same query and custom post type setup and am having the exact same problem. To include the custom post type posts, we will use pre_get_posts to add your custom post type to category and tag archive pages add_action( 'pre_get_posts', function ( $q ) { if Same thing also happens if i try to view the actual archive, eg. "site.com/case" and not "site.com/case/case-item". I'm using Daan's code and if I can fix this small issue, it'll be exactly what I need.

My final working code is: if ( ! Adam Permalink to comment# August 12, 2013 Thanks Jon. How to address friction between estimation requests and delivery commitment How secure is iterative password enhancement? Many thanks for your time and help. array( 'name' => __( 'Photos' ), 'singular_name' =>

How do we show that the function which is its own derivative is exponential? asked 3 years ago viewed 7901 times active 1 year ago Blog How We Make Money at Stack Overflow: 2016 Edition Stack Overflow Podcast #94 - We Don't Care If Bret From what I can gather from your question, you have already use pre_get_posts to add your custom post type to category and tag archives. On the pages where this function is being used (the category archive for my custom post type), these widgets are getting confused, and show the content of a different post type