WordPress.org

Ready to get started?Download WordPress

Forums

WordPress title permalink for custom post type (1 post)

  1. girll
    Member
    Posted 8 months ago #

    Hi all. I have a question. I register new post type and I want its title as permalink to single post's page.

    Here is my code:

    register_post_type('video', array(
    			'label' => __('Videos'),
    			'singular_label' => __('video'),
    			'public' => true,
    			'show_ui' => true, // UI in admin panel
    			'capability_type' => 'post',
    			'hierarchical' => false,
    			'rewrite' => array("slug" => "video"), // Permalinks format
    			'supports' => array('title','author')
    		));

    And the permalink:

    <h1 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>

    I want it open like posts with post_type post. How to do it?

Reply

You must log in to post.

About this Topic