• Resolved walbadynamics

    (@walbadynamics)


    Remove url ?directory_type=general.
    All categories and locations add this url, how do I remove it?

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Support Mahfuzul Alam

    (@mahfuz87)

    Hi @walbadynamics

    Thank you for reaching out. This will require applying some custom code to solve this issue. Please use a child theme or a code snippet plugin to implement this code on your website. If you use a child theme, please add the following code at the end of the function.php file you will find inside the child theme –

    add_filter('term_link', function ($url, $term, $taxonomy) {
    
    // Categories
    
    if (ATBDP_CATEGORY === $taxonomy) {
    
    $url = ATBDP_Permalink::atbdp_get_category_page($term);
    
    }
    
    // Location
    
    if (ATBDP_LOCATION === $taxonomy) {
    
    $url = ATBDP_Permalink::atbdp_get_location_page($term);
    
    }
    
    // Tag
    
    if (ATBDP_TAGS === $taxonomy) {
    
    $url = ATBDP_Permalink::atbdp_get_tag_page($term);
    
    }
    
    return $url;
    
    }, 20, 3);
    
    add_filter('atbdp_single_category', function ($link) {
    
    // Parse the URL
    
    $parsedUrl = parse_url($link);
    
    // Reconstruct the modified URL without parameters
    
    $modifiedLink = $parsedUrl['scheme'] . '://' . $parsedUrl['host'] . $parsedUrl['path'];
    
    return $modifiedLink;
    
    });
    
    add_filter('atbdp_single_location', function ($link) {
    
    // Parse the URL
    
    $parsedUrl = parse_url($link);
    
    // Reconstruct the modified URL without parameters
    
    $modifiedLink = $parsedUrl['scheme'] . '://' . $parsedUrl['host'] . $parsedUrl['path'];
    
    return $modifiedLink;
    
    });

    I believe this will help you to achieve what you are looking for. Please let me know if you need further assistance.

    Kind Regards

Viewing 1 replies (of 1 total)
  • The topic ‘Remove url ?directory_type=general’ is closed to new replies.