How can we help?

If you are looking for support for our Poka theme, this is the place!

Home Forums Poka v2 support How to change the review link in pokatheme?

This topic contains 3 replies, has 3 voices, and was last updated by  admin 4 months, 1 week ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1803

    Ermin Rajic
    Participant

    Hi guys and girls im just triyng the poke them for the first time on my site http://betting24.nu and i really like it but its also new for me so thereare some things im still struggelning on. For example right now i want my review links for ex http://www.betting24.nu/review/leovegas/ so be http://www.betting24.nu/recension/leovegas/ and i cant figer out how to change this=( There is a way to change the breadcrums and choose a site the “review” links to but i want to change the link=( Anybody know how to do this?

    #1814

    admin
    Keymaster

    Hi Ermin,

    In your child theme inside functions.php you’ll find a snippet called “Change CPT slug”
    In specific:

    add_filter( 'register_post_type_args', 'change_slug_affiliates_cpt', 10, 2 );
    function change_slug_affiliates_cpt( $args, $post_type ) {
    
        if ( $post_type == 'affiliates') {
            $args['rewrite']['slug'] = 'affiliatesnewslug';
        }
    
        return $args;
    }

    You should activate your child theme in order to have the ability to make future changes and remove the comment from this snippet.
    After that you can change the word “affiliatesnewslug” with your own slug.

    #2022

    casino1
    Participant
    This reply has been marked as private.
    #2032

    admin
    Keymaster

    Hi!

    In the breadcrumb the name you see is the label->name of the CPT.
    If you want to also change this Name you can change the above snippet with the following:

    add_filter( 'register_post_type_args', 'change_slug_affiliates_cpt', 10, 2 );
    function change_slug_affiliates_cpt( $args, $post_type ) {
    
        if ( $post_type == 'affiliates') {
            $args['rewrite']['slug'] = 'affiliatesnewslug';
            $args['labels']['name'] = 'Recension';
        }
    
        return $args;
    }
Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.