Forum Replies Created

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

    (@s2_krish)

    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

    <?php
    /*
    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',
    ) );
    }

    Thread Starter Elisa

    (@s2_krish)

    Thank you Jessn

    I did you as suggest. However blog doesn’t get blog prefix. Now
    mysite.com/2012/12/celebrating-the-two-glorious-year/. I always want blog to be accessed with blog prefix in url like mysite.com/blog/2012/12/celebrating-the-two-glorious-year/

    Thread Starter Elisa

    (@s2_krish)

    For security/privacy reason, may be I don’t share phpinfo() here. Can you tell me what should I look for in phpinfo().

Viewing 3 replies - 1 through 3 (of 3 total)