I created a post type called listingand a companion archive page archive-listing.php. When I go to /listings, the archive page loads properly. However, I would like the archive URL to be /marketplace. I define the property rewritebelow, but it does not seem to work. What am I missing?
register_post_type("listing",
array(
"menu_icon" => "dashicons-tag",
"labels" => array(
"name" => __( "Listings" ),
"singular_name" => __("Listing")
),
"public" => true,
"has_archive" => true,
"rewrite" => array("slug" => "marketplace"),
"supports" => array("title", "editor"),
"taxonomies" => array("listing_status")
)
);
source
share