Skip to main content
deleted 79 characters in body
Source Link
user31344
  • 115
  • 1
  • 5
  • 9

I created a custom post type with a taxonomy defined, but I am having trouble getting an archive page to show up.

Two Issues.

  1. I get a 404 page not found. The individual post shows up but nothing on archives page.

  2. Am using ACF (custom Fields) and can't get them to show up.

    I get a 404 page not found. The individual post shows up but nothing on archives page.

functions php.

function create_post_type() {  
    register_post_type( 'my_properties',  
        array(  
            'labels' => array(  
                'name' => __( 'Commercial Properties' ),  
                'singular_name' => __( 'My Property' )  
            ),  
        'public' => true,  
        'menu_position' => 5,  
        'rewrite' => array('slug' => 'Myproperties')  
        )  
    );  
}  
  
add_action( 'init', 'create_post_type' ); 

function property_taxonomy() {  
   register_taxonomy(  
    'properties',  
    'my_properties',  
    array(  
        'hierarchical' => true,  
        'label' => 'Category',  
        'query_var' => true,  
    )  
);  
}  
  
add_action( 'init', 'property_taxonomy' );  

I have tried:

• Creating an archive-my_properties.php (should the page be named after the registration or the slug? • Resaved permalinks • Flushed Rewrite rules

I created a custom post type with a taxonomy defined, but I am having trouble getting an archive page to show up.

Two Issues.

  1. I get a 404 page not found. The individual post shows up but nothing on archives page.

  2. Am using ACF (custom Fields) and can't get them to show up.

functions php.

function create_post_type() {  
    register_post_type( 'my_properties',  
        array(  
            'labels' => array(  
                'name' => __( 'Commercial Properties' ),  
                'singular_name' => __( 'My Property' )  
            ),  
        'public' => true,  
        'menu_position' => 5,  
        'rewrite' => array('slug' => 'Myproperties')  
        )  
    );  
}  
  
add_action( 'init', 'create_post_type' ); 

function property_taxonomy() {  
   register_taxonomy(  
    'properties',  
    'my_properties',  
    array(  
        'hierarchical' => true,  
        'label' => 'Category',  
        'query_var' => true,  
    )  
);  
}  
  
add_action( 'init', 'property_taxonomy' );  

I have tried:

• Creating an archive-my_properties.php (should the page be named after the registration or the slug? • Resaved permalinks • Flushed Rewrite rules

I created a custom post type with a taxonomy defined, but I am having trouble getting an archive page to show up.

  1. I get a 404 page not found. The individual post shows up but nothing on archives page.

functions php.

function create_post_type() {  
    register_post_type( 'my_properties',  
        array(  
            'labels' => array(  
                'name' => __( 'Commercial Properties' ),  
                'singular_name' => __( 'My Property' )  
            ),  
        'public' => true,  
        'menu_position' => 5,  
        'rewrite' => array('slug' => 'Myproperties')  
        )  
    );  
}  
  
add_action( 'init', 'create_post_type' ); 

function property_taxonomy() {  
   register_taxonomy(  
    'properties',  
    'my_properties',  
    array(  
        'hierarchical' => true,  
        'label' => 'Category',  
        'query_var' => true,  
    )  
);  
}  
  
add_action( 'init', 'property_taxonomy' );  

I have tried:

• Creating an archive-my_properties.php (should the page be named after the registration or the slug? • Resaved permalinks • Flushed Rewrite rules

Source Link
user31344
  • 115
  • 1
  • 5
  • 9

Archive Page Not Found on Custom Post Type

I created a custom post type with a taxonomy defined, but I am having trouble getting an archive page to show up.

Two Issues.

  1. I get a 404 page not found. The individual post shows up but nothing on archives page.

  2. Am using ACF (custom Fields) and can't get them to show up.

functions php.

function create_post_type() {  
    register_post_type( 'my_properties',  
        array(  
            'labels' => array(  
                'name' => __( 'Commercial Properties' ),  
                'singular_name' => __( 'My Property' )  
            ),  
        'public' => true,  
        'menu_position' => 5,  
        'rewrite' => array('slug' => 'Myproperties')  
        )  
    );  
}  
  
add_action( 'init', 'create_post_type' ); 

function property_taxonomy() {  
   register_taxonomy(  
    'properties',  
    'my_properties',  
    array(  
        'hierarchical' => true,  
        'label' => 'Category',  
        'query_var' => true,  
    )  
);  
}  
  
add_action( 'init', 'property_taxonomy' );  

I have tried:

• Creating an archive-my_properties.php (should the page be named after the registration or the slug? • Resaved permalinks • Flushed Rewrite rules