WordPress.org

Ready to get started?Download WordPress

Forums

Search base rewrite (1 post)

  1. martin.kovac
    Member
    Posted 1 year ago #

    Hi,

    I have this code:

    function blog_rewrite_rules(){
        global $wp_rewrite;
    
        $wp_rewrite->search_base = 'my_search/';
        $wp_rewrite->pagination_base = 'my_page/';
        $wp_rewrite->flush_rules();
    }
    add_action('init', 'blog_rewrite_rules');

    pagination base is working fine but search doesn't. It still generate url like ...?s=pattern&submit=Search

    Permalink settings is set to Post name

    What is wrong. Is there some code missing?

    Thank you.

Topic Closed

This topic has been closed to new replies.

About this Topic