WordPress.org

Ready to get started?Download WordPress

Forums

Custom post type list without a custom loop (1 post)

  1. caugb
    Member
    Posted 3 years ago #

    Hi
    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 the same
    exactly rewrite rules!!!

    PS. there is not a page or post with the slug 'store' .

    Any help would be appreciated

Topic Closed

This topic has been closed to new replies.

About this Topic