• Resolved stanza237

    (@stanza237)


    I need to show the tag page in 2 versions, one reached from the normal link /tag/slug-tag and one changing the tag prefix: /lp/slug-tag.
    The page should be called adding a GET parameter, like: /index.php?tag=slug-tag&type=landing
    I’ve tried adding a RewriteRule on the htaccess
    RewriteRule ^lp/(.*)$ /index.php?tag=$1&type=landing [L]
    but it doesn’t work…
    I think I need to use a filter on tag_link
    add_filter(‘tag_link’,’landing_permalink’, 10, 2);
    but I don’t know how…

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter stanza237

    (@stanza237)

    i found this other function
    add_action(‘generate_rewrite_rules’, ‘tag_rewrite_rules’);
    function tag_rewrite_rules( $wp_rewrite )
    {
    $new_rules = array(
    ‘lp/(.+?)/?$’ => ‘index.php?’ .
    ‘tag=’ . $wp_rewrite->preg_index(1) .
    ‘&type=landing’
    );

    $wp_rewrite->rules = $new_rules + $wp_rewrite->rules;
    }

    it adds the right rewrite rule to $wp_rewrite->rewrite_rules()
    but still doesn’t work

    Thread Starter stanza237

    (@stanza237)

    I had the refresh the permalink structure!
    Now it works!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Duplicate tag page, with different permalink’ is closed to new replies.