Okay
  Public Ticket #2734812
Naming "knowledgebase" + "knowledgebase-category"
Closed

Comments

  • Kai Uwe Gurski started the conversation

    Hi,

    I named my starting page for the knowledge base "wissen", which is the German term for it. If I now create categories and knowledges, it's named "knowledgebase" and "knowledgebase-category" in the links.

    Is there a way I can change the term internally? Also afterwards now?

    Thanks for your support.

  •  1,049
    ModelTheme replied

    Hello Kai Uwe Gurski,

    To change the knowledgebase slug please go to functions.php from your child theme and add this code:

    add_filter( 'register_post_type_args', 'mtkb_register_post_type_args', 10, 2 );
    function mtkb_register_post_type_args( $args, $post_type ) {
        if ( 'mtkb-knowledgebase' === $post_type ) {
            $args['rewrite']['slug'] = 'new-knowledgebase'; /*ADD YOUR OWN SERMON SLUG ONLY ON THIS LINE */
        }
        return $args;
    }

    and for the "knowledgebase-category" taxonomy Slug please use this code:

    function mtkb_update_taxonomy_slug() {
        // Current taxonomy name (not slug) -> 'mtkb-knowledgebase-category'
        $sermon_category_args = get_taxonomy( 'mtkb-knowledgebase-category' ); // returns an object
        $sermon_category_args->show_admin_column = true;     // Here we will add the new slug 'new' instead of 'knowledgebase-category'
        $sermon_category_args->rewrite['slug'] = 'new';  /* HERE WE ADDED THE NEW LINK ------*/
        $sermon_category_args->rewrite['with_front'] = false;
        
        // re-register the taxonomy
        register_taxonomy( 'mtkb-knowledgebase-category', 'mtkb-knowledgebase', (array) $sermon_category_args );
    }
    // hook it up to 11 so that it overrides the original register_taxonomy function
    add_action( 'init', 'mtkb_update_taxonomy_slug', 11 );

    Important: Reset the Permalinks after adding the code, in case you see 404 error when accessing the link.

    Let me know the results after do that.


    Regards!



    ModelTheme Help Team

    We are located in GMT +3 time zone and we answer all questions within 12-48 hours in weekdays. In some rare cases the waiting time can be to 48 hours. Support tickets sent during weekends or public holidays will be processed next Monday or the next business day.

    Website: https://modeltheme.com/ | ThemeForest Portfolio

  •  1,049
    ModelTheme replied

    Hello Kai Uwe Gurski,

    If you have any other questions please contact us with details and I will be glad to help you out with anything.

    Best regards and have a nice day,

    - Andreea from Modeltheme


    ModelTheme Help Team

    We are located in GMT +3 time zone and we answer all questions within 12-48 hours in weekdays. In some rare cases the waiting time can be to 48 hours. Support tickets sent during weekends or public holidays will be processed next Monday or the next business day.

    Website: https://modeltheme.com/ | ThemeForest Portfolio