Support » Fixing WordPress » Customized permalink structure for custom post type and default post type conten

  • Hi,

    I have website with single WP-installation. I have lot of types of custom contents- video, music

    1. I have used default pages type for fixed page such as about us, contact etc
    2. I have used default post type for blog
    3. Videos for video and music for music

    In my custom theme, I have create archive-video.php, video.php, archive-music.php, music.php templates to list music and videos in different layout format. page type are displayed using php.php and posts are handled by index.php and single.php.

    URL for each content type are

    1. Video –
    2. Music –
    3. Blog and Page –

    Now, I need to change Blog url as I am able to do so by adding prefix blog in permalink structure from (WP-Admin -> Settings -> Permalink, Custom structure)

    Problem start here, URL for music and video do not work. They need to be access and (blog is added on each)

    I want to work,,, (with single WP installation).

    Any suggestion, how can I acheive this

Viewing 3 replies - 1 through 3 (of 3 total)
  • You should be able to create a page called “Blog”, and then under “Settings”–>”Reading” pick a page to be used as the home page, and a page to be used for the blog page. When you do this, the page “Blog” will use the index.php template by default and should behave as a blog, and you don’t need to rewrite your URLs to make it work.

    Thank you Jessn

    I did you as suggest. However blog doesn’t get blog prefix. Now I always want blog to be accessed with blog prefix in url like

    I am posting code here, main thing is ‘with_front’ => false,

    Code snippted

    rewrite' =>
      array (
        'slug' => 'testimonials',
        'with_front' => false,
        'pages' => true,
        'feeds' => 'testimonials',

    Full plugin code is

    Plugin Name: Hide blog
    Version: 1.0
    Plugin URI: h
    Description: Hide the blog prefix
    Author URI:
    add_action( 'init', 'register_my_cpt_testimonials', 10 );
    function register_my_cpt_testimonials() {
    register_post_type( "testimonials", array (
      'labels' =>
      array (
        'name' => 'Testimonials',
        'singular_name' => 'Testimonial',
        'add_new' => 'Add New',
        'add_new_item' => 'Add New Testimonial',
        'edit_item' => 'Edit Testimonial',
        'new_item' => 'New Testimonial',
        'view_item' => 'View Testimonial',
        'search_items' => 'Search Testimonials',
        'not_found' => 'No testimonials found',
        'not_found_in_trash' => 'No testimonials found in Trash',
        'parent_item_colon' => 'Parent Testimonial:',
      'rewrite' =>
      array (
        'slug' => 'testimonials',
        'with_front' => false,
        'pages' => true,
        'feeds' => 'testimonials',
      'has_archive' => 'testimonials',
      'query_var' => 'testimonials',
    ) );

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Customized permalink structure for custom post type and default post type conten’ is closed to new replies.