Forum Replies Created

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter arnus71

    (@arnus71)

    I tried this again on a new db but got the same result. Then I found out why this wasn’t working – the setting 'with_front' => true should be 'with_front' => false giving the following:

    'rewrite' => array(
    	'slug' => 'case-studies',
    	'with_front' => false

    And it is imperative to refresh permalinks!
    Sounds pretty logical now…

    • This reply was modified 4 years, 1 month ago by arnus71.
    Thread Starter arnus71

    (@arnus71)

    Thanks for your help. I redid the steps just like you did above but I still get the same result – /blog/case-studies. Checked in another browser but still the same. No idea. I may just try a new db and see what happens – the current one has seen a lot of experimentation and may be the cause of this not working.

    • This reply was modified 4 years, 1 month ago by arnus71.
    Thread Starter arnus71

    (@arnus71)

    No problem.

    I had refreshed the permalinks already but no dice. Also removed the htaccess file so it would generate a new one, but still no change.

    Maybe I should remove the /blog from the permalinks to get the case-studies to show in the root and then do another rewrite specifically for the blog posts to show in /blog?

    Thread Starter arnus71

    (@arnus71)

    Thank you, wish me luck! ??

    Thread Starter arnus71

    (@arnus71)

    Yes

    Thread Starter arnus71

    (@arnus71)

    Sorry, I’m not a developer, just doing my best by trying to understand it all.

    I am registering the CPT in my own code because the use of plugins wasn’t getting me where I wanted.

    This is the full contents of my funcions.php in my child theme where I declare the CPT and its categories. Maybe you can spot what is wrong with this because the url for case-studies still has /blog in front of it. Thanks for any help!

    /*Custom Post type start*/
    function cw_post_type_casestudies() {
    $supports = array(
    'title', // post title
    'editor', // post content
    'author', // post author
    'thumbnail', // featured images
    'excerpt', // post excerpt
    'custom-fields', // custom fields
    'comments', // post comments
    'revisions', // post revisions
    'post-formats', // post formats
    );
    $labels = array(
    'name' => _x('Case Studies', 'plural'),
    'singular_name' => _x('Case Study', 'singular'),
    'menu_name' => _x('Case Studies', 'admin menu'),
    'name_admin_bar' => _x('Case Studies', 'admin bar'),
    'add_new' => _x('Add New', 'add new'),
    'add_new_item' => __('Add New Case Study'),
    'new_item' => __('New Case Study'),
    'edit_item' => __('Edit Case Study'),
    'view_item' => __('View Case Study'),
    'all_items' => __('All Case Studies'),
    'search_items' => __('Search Case Studies'),
    'not_found' => __('No Case Studies found.'),
    );
    $args = array(
    'supports' => $supports,
    'labels' => $labels,
    'public' => true,
    'query_var' => true,
    'rewrite' => array(
    	'slug' 			=> 'case-studies',
    	'with_front'    => true,
    	'pages'         => true,
    	'feeds'         => true,
    ),
    'has_archive' => true,
    'hierarchical' => false,
    'menu_position' => 4,
    'menu_icon' => 'dashicons-id-alt',
    );
    register_post_type('case-studies', $args);
    }
    add_action('init', 'cw_post_type_casestudies');
    
    /*Custom Post type end*/
    
    /*Custom categories for Case Studies start*/
    function tr_create_my_taxonomy() {
    
        register_taxonomy(
            'case-studies-category',
            'case-studies',
            array(
                'label' => __( 'Categories' ),
                'rewrite' => array( 'slug' => 'case-studies-category' ),
                'hierarchical' => true,
            )
        );
    }
    add_action( 'init', 'tr_create_my_taxonomy' );
    /*END Custom categories for Case Studies start*/
    Thread Starter arnus71

    (@arnus71)

    Thanks FullWorks! Would this best be placed in the functions.php of my child theme? And will it overwrite the blog slug?

    • This reply was modified 4 years, 1 month ago by arnus71.

    Great idea! I have the same request.

    Regards
    Arnaud.

    Wat ik heb gedaan is de afbeelding die je als Uitgelichte afbeelding gebruikt NIET opnemen in de gallerij. Daardoor is deze maar een keer te zien: https://www.autokopenopcuracao.com/occasions/

    Of is dit niet wat je bedoelt? Heb je een voorbeeld URL?

    groeten
    Arnaud.

    Thread Starter arnus71

    (@arnus71)

    Thanks for the info, good to know some background information concerning this issue.

    Thread Starter arnus71

    (@arnus71)

    Great! I validated my page and everything looks good.

    When I google for the site, the stars still do not appear in the search results. @gowebsol, you state that the rest is up to them, but there must be something I can do to get the stars to appear?

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