WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Permalinks help (5 posts)

  1. alev
    Member
    Posted 3 years ago #

    Hi everyone
    Ok here is problem
    I have been using this " /index.php/%year%/%monthnum%/%day%/%postname%/ " permalinks code for site with static pages and it woks fine, I no longer have to see links ID # but as soon as I use this all the post links are lost ( broken).
    Any way I can have both working so all the posts as pages are will be using post/page name and not index ID number

    I appreciate any suggestions.

    Thank you in advance

    Lev

  2. extatix
    Member
    Posted 3 years ago #

    I had this too when changing permalinks, adding this to my functions.php worked:

    flush_myrewrite_rules();
    function flush_myrewrite_rules() {
        global $wp_rewrite;
        $wp_rewrite->flush_rules();
    }
  3. alev
    Member
    Posted 3 years ago #

    So you use same permalink code and just add scrip you are showing in functions.php . is there an specific place it has to be?

  4. extatix
    Member
    Posted 3 years ago #

    No, not specific.
    But I call it in an init-function btw.

    function flush_myrewrite_rules() {
        global $wp_rewrite;
        $wp_rewrite->flush_rules();
    }
    add_action('init', 'flush_myrewrite_rules');
  5. alev
    Member
    Posted 3 years ago #

    Thanx extatix
    It working fine
    Thank you very much

    Lev

Topic Closed

This topic has been closed to new replies.

About this Topic