I have a custom "about" post:
function about_register() {
$labels = array(
'name' => _x('About Page', 'post type general name'),
'singular_name' => _x('About Item', 'post type singular name'),
'add_new' => _x('Add New', 'About Item'),
'add_new_item' => __('Add New About Item'),
'edit_item' => __('Edit About Item'),
'new_item' => __('New About Item'),
'view_item' => __('View About Item'),
'search_items' => __('Search Team'),
'not_found' => __('Nothing found'),
'not_found_in_trash' => __('Nothing found in Trash'),
'parent_item_colon' => ''
);
$args = array(
'labels' => $labels,
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'query_var' => true,
'rewrite' => true,
'capability_type' => 'post',
'hierarchical' => false,
'menu_position' => null,
'has_archive' => 'about',
'supports' => array('title','thumbnail')
);
register_post_type( 'custom_about_post' , $args );
}
I created a page called archive-about.php and put my Wordpress loop in there and pulled up my custom meta information.
However, when I go to mysite.com/about I get a 404 error.
Searching the internet -
I went to my permalinks page and tried to flush rewrite rules by hitting save.
I was instructed to put the following into my sites .htaccess file:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /mysite.com/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /iqfood/index.php [L]
</IfModule>
# END WordPress
However, when I did this my entire site is now 403! If I remove this and leave my .htaccess file blank my site returns...but the link
localhost/mysite/about/
still doesn't work.
In order to make the archives work, do I use the default settings in permalinks or something else?
What should I be setting my rewrite rules to in Mac OSX (snow leopard) to run Wordpress locally?
Is there something wrong in the code posted above?
'has_archive' => 'about'
is incorrect first of all, it has to be eithertrue
orfalse
, refer to codex.wordpress.org/Function_Reference/register_post_type