amg-smit
Forum Replies Created
-
I have about 8 categories, and none of them are linked to specific pages, only archives, which are not listed in the page sitemap.
Forum: Fixing WordPress
In reply to: Permalinks go 404 on custom post typesI also found another solution:
http://codex.wordpress.org/Custom_Queries#Permalinks_for_Custom_Archives
Forum: Fixing WordPress
In reply to: Permalinks go 404 on custom post typesOk, I can’t figure out what makes the difference, but registering my post types through a simple plugin, as advised by Andrew (read the first comment on this topic) and only calling the flush-function on activation does the job. The code is simple, feel free to use and adjust:
<?php /* Plugin Name: Custom post types Plugin URI: http://wordpress.org/support/topic/permalinks-go-404-on-custom-post-types?replies=1#post-2301511 Description: This plugin registers CPT's and runs flush_rewrite_rules() on activation, which in some extraordinary cases makes automatic permalinking work. For more information see the help topic http://wordpress.org/support/topic/permalinks-go-404-on-custom-post-types?replies=1#post-2301511 Author: Josse Zwols & Geert Smit Version: 1.6 Author URI: http://forgia.nl */ add_action( 'init', 'create_my_post_types' ); function create_my_post_types() { register_post_type( 'auctions', array( 'labels' => array( 'name' => __( 'Auctions' ), 'singular_name' => __( 'Auction' ) ), 'public' => true, 'has_archive' => true, ) ); //flush_rewrite_rules( false ); } register_activation_hook( __FILE__, 'create_my_post_types' ); register_activation_hook( __FILE__, 'flush_rewrite_rules' ); ?>Forum: Fixing WordPress
In reply to: Permalinks go 404 on custom post typesBut that’s exactly my point. I can keep refreshing settings > Permalinks but it doesn’t make a difference. So I guess a plugin is the only way to go.
Forum: Fixing WordPress
In reply to: Permalinks go 404 on custom post typesOk, so what you’re actually saying, is that I should register the post type with a plugin? Because that’s not what all the tutorials say, so this is kind of new to me. Untill now, I’ve put the code for registering the post type in the functions.php.
I think I know what to do for now: learning to create plugins, never did that before 🙂