0

I need to add via the functions.php at the end of the parameter ?Piura. Since I am using this code so that all users who have the ?Piura parameter have a special code.

The problem is that the url generated from the products do not carry the source parameter and this parameter is lost.

How would you do that also when you enter with the pararetro

www.example/prodcucto/cup?piura

The url generated from other products also have the parameter ?Piura

My code:

if(isset($_GET['piura'])) {
add_action('init', 'dcms_page_permalink', 0);
function dcms_page_permalink() {
    global $wp_rewrite;

    if ( !strpos($wp_rewrite->get_page_permastruct(), '?piura')){
        $wp_rewrite->page_structure = $wp_rewrite->page_structure . '?piura';
    }
}

Not work :( }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.