Custom post type list without a custom loop
I’m working with a post type ‘product’, created in this way:
$args = array( [...] 'rewrite' => array('slug' => 'store', 'with_front' => false), [...] );
in my local system I get the products list accessing
http://mysite.com/store/without any extra code, the products list happens naturally… but when I try it online, I get a 404 error (page not found).
Searching this forum, I see several items showing custom loops to display custom posts. Is it necessary? So, why it works in my local server?
The rewrite rules are the same in both installations (after flushing), but $wp_query shows that in local machine
$wp_query->query_vars['post_type'] = 'product'while in online version, $wp_query points to a unknown ‘page’ – with exactly the same
PS. there is not a page or post with the slug ‘store’ .
Any help would be appreciated
- The topic ‘Custom post type list without a custom loop’ is closed to new replies.