How can we help?

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

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

This topic contains 7 replies, has 5 voices, and was last updated by  casino1 5 months, 3 weeks ago.

Viewing 8 posts - 1 through 8 (of 8 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; }

    #2781

    Krzysztof Olszewski
    Participant

    That working great thanks, but how can i edit my page with review? Simple i have a website xxxxx.com/review/leovegas-casino, and i want change content on my page xxxxx.com/review/ How can i do it?

    #2814

    admin
    Keymaster

    Hi!

    First you have to disable archive page for the reviews by changing the code above to this:

    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'; $args['has_archive'] = false; } return $args; }

    Now we removed the archive page you can create a new custom page with the slug /review/.

    #4205

    Nir Levy
    Participant

    Hi guys,

    After changing the review slug, every new review I want to upload respond as expected.

    The issue is that the reviews I made live before the CPT slug change didn’t change their slug to the new one. (I flushed cached)

    Is there any way to make the change also retroactive?

    Thanks!

    #4207

    casino1
    Participant

    Hi,

    Have you tried to updated permalinks? Sounds like they need a nudge.

    Go to Settings -> Permalinks -> click save settings (no need to change anything) and the old reviews slug should be updated as well.

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.