• Resolved Crock

    (@magesh7)


    I first Thanks this author, making a great plugin. I have a issue.

    in wp-category-archive.php file
    $url = get_option(‘home’) . “/?m=” . $year_month_value . “&cat=” . $category_id;

    i need to change the like
    http://www.example.com/category/year

    so i haved like
    $url = get_option(‘home’) .”/”. $category.”/”.$year_month_value;
    and now changed the url http://www.example.com/category/year.

    but Getting 404 error.
    Nothing Found Error.

    How to Fix or Change the like mentioned above. please anyone . ? Help me!!

    https://ww.wp.xz.cn/plugins/wp-category-archive/

    and I am not interest to change the permalinks . Because it Cause Changed whole site. or else. Is possible to set the permalinks for particular plugin. or page.?? without affecting default permalinks.

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

    (@magesh7)

    Please Help me. Anyone having the same issue. or anyone can have idea to help me,. i was suffered past 10 days please help me

    Thread Starter Crock

    (@magesh7)

    I was Fixed.

    Step1:-
    go to plugins/wp-category-archive/wp-category-archive.php

    Change $url value line 59

    $url = home_url(‘/’);
    $url .=”?category_name=” . $category;
    $url.=”&year=”.$year_month_value;

    Step2:- Add the below code in theme function.php

    add_action(‘init’, ‘category_rewrite’);
    function category_rewrite() {
    global $wp_rewrite;
    $rule = ‘(.+?)/(\d+)/?$’;
    //$rewrite = ‘index.php?year=$matches[2]&category_name=$matches[1]’;
    add_rewrite_rule($rule,$rewrite,’top’);
    $wp_rewrite->flush_rules();
    }

    Final and Last Step:-
    go to plugins/wp-category-archive/wp-category-archive.php
    change the code return ($url); to
    return (home_url(‘/’).$category.”/”.$year_month_value. “/”);

    Now accessing the http://www.example.com/category/year..

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Change the URL’ is closed to new replies.