Forums

Custom posttype with list categories (4 posts)

  1. baszer
    Member
    Posted 6 months ago #

    Hello,

    I made a custom posttype and also some custom taxonomies with it.

    I can list my customposttypes and I created my list of custom taxonomies with the following code:

    <?php
    
    $orderby = 'name';
    $show_count = 0; // 1 for yes, 0 for no
    $pad_counts = 0; // 1 for yes, 0 for no
    $hierarchical = 1; // 1 for yes, 0 for no
    $taxonomy = 'nameofposttype';
    $title = '';
    
    $args = array(
      'orderby' => $orderby,
      'show_count' => $show_count,
      'pad_counts' => $pad_counts,
      'hierarchical' => $hierarchical,
      'taxonomy' => $taxonomy,
      'title_li' => $title
    );
    ?>
    <ul>
    <?php
    wp_list_categories($args);
    ?>
    </ul>

    I get my list of custom post tyes, but when I hit one of the URLs I get the 404 error page. What is going wrong?

    this is the link (which is giving the error) /?nameofposttype=type-ijshockey

  2. Rev. Voodoo
    Volunteer Moderator
    Posted 6 months ago #

    after creating your post type/tax, did you ever flush the rewrite rules?

    If you don't do it in the code, then yu need to do it by visiting settings->permalinks and just hitting save

  3. baszer
    Member
    Posted 6 months ago #

    hmmm, did not work. If i change my permalinks to something else I get only errors...

  4. baszer
    Member
    Posted 6 months ago #

    is there a way to delete/reset all the permalinks etc?

    this is the url with the problem

Reply

You must log in to post.

About this Topic

Tags

No tags yet.