• I created a custom post type with a plugin. Below is the code

    add_action( 'init', 'create_sjl_music' );
    function create_sjl_music() {
        register_post_type( 'sjl_music',
            array(
                'labels' => array(
                    'name' => 'Music',
                ),
                'public' => true,
    			'description', 'Holds data for music files',
                'menu_position' => 5,
    			'rewrite' => array('slug' => 'music'),
                'supports' => array( 'title' ),
                'taxonomies' => array( '' ),
    			'has_archive' => true,
                'menu_icon' => plugins_url( 'images/sjl-music.png', __FILE__ )
            )
        );
    }

    (I use almost the exact same code for another custom post type and it doesn’t have this problem.)

    The problem is that the individual posts will display correctly. Ex. https://de-blase.com/music/mustache-mix-002/

    But the archive page (https://de-blase.com/music/) gives a 404 error.

    I’m using this permalink structure:
    https://de-blase.com/%category%/%postname%/

    and i’ve flushed the permalinks twice.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter pixelboy7734

    (@pixelboy7734)

    I should add that I developed this locally and it worked correctly. I have a page named “archive-sjl_music.php” that it serves locally for the archive.

    Thread Starter pixelboy7734

    (@pixelboy7734)

    Also, when I get the 404 error, it’s a go daddy 404 page not the template 404 page which works fine in other places.

    Could it be that the htaccess file isn’t sending pages to the right file?

    Thread Starter pixelboy7734

    (@pixelboy7734)

    Here was the problem although no one else will run into it.

    There was a directory named “music” on the site that was unused. I deleted that and then the archive page was served correctly.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom Post Archive Not Displaying, Custom Posts Fine’ is closed to new replies.