WordPress.org

Ready to get started?Download WordPress

Forums

Why is my archive page not showing up? (1 post)

  1. iasonvdm
    Member
    Posted 1 year ago #

    Ok so I made this wordpress archive-mynews.php and a single-mynews.php
    single-mynews.php contains the comment to let wordpress know this is my single page "Template Name: Single mynews".

    Now when I hit http://url.com/mynews it redirects me to the home page instead of to the archive page I just created. Why is this, am I forgetting something?

    I already made a custom poste type in functions.php
    I did it like hits.

    add_action( 'init', 'create_post_type' );
    function create_post_type() {
    register_post_type( 'mynews',
    		array(
    			'labels' => array(
    				'name' => __( 'Mynews' ),
    				'rewrite' => array('slug' => 'mynews'),
    				'singular_name' => __( 'Mynews' )
    			),
    		'public' => true,
    		'has_archive' => true,
    		'hierarchical' => true,
    		'supports' => array('title','editor','thumbnail'),
    		)
    	);
    }

    Can anybody tell me why it's not working or what I am forgetting because I can't seam to figure it out.

    Thanks in advance.

Topic Closed

This topic has been closed to new replies.

About this Topic