• Resolved Aishwarya Taneja

    (@aishwaryataneja85)


    File: post.php
    Where: in the wp includes folder

    How do I change code in the post.php file in the wp includes folder and yet allow WordPress to update automatically? I had to change a part of the code on line 1410 in the post.php file.

    `” if ( ! isset( $args->rewrite[‘with_front’] ) )
    $args->rewrite[‘with_front’] = true;”`

    to

    `” if ( ! isset( $args->rewrite[‘with_front’] ) )
    $args->rewrite[‘with_front’] = false;”`

    Thanks.

Viewing 9 replies - 1 through 9 (of 9 total)
  • You aren’t going to be able to do what you’re trying to do. If you edit a core file like you’re doing, the change will be reverted once WordPress updates. You’ll either have to reapply the change every time WordPress updates or find another way to do what you’re trying to do by changing post.php.

    Thread Starter Aishwarya Taneja

    (@aishwaryataneja85)

    Is there no way to go about this? I am new to WordPress. But I know that in coding, anything is possible. ??

    Why were you changing that line in post.php?

    Thread Starter Aishwarya Taneja

    (@aishwaryataneja85)

    I’m using a paid plugin which makes use of the custom permalink slug. So if I have /blog/%postname%/ as the custom permalink structure then the plugin’s permalink structure adds the /blog slug to itself. To stop that from happening I had to change with_front value from true to false in the post.php file.

    Have you spoken with the plugin’s authors? This can’t be the first time they’ve ever had this issue come up before.

    Thread Starter Aishwarya Taneja

    (@aishwaryataneja85)

    I already have. He bluntly said he can’t do anything about it. I have been trying to understand and solve it from the last 24 hours. Changing with_front value from true to false is the only solution I could figure out so far. But then I need to do it in some other way.

    Isn’t there a plugin which allows to change the WordPress core code?

    I’m not aware of any plugin that does so, mostly because it would be antithetical to the entire purpose of having a plugin system.

    Could you use a different permalink structure or does the plugin require that you use that particular permalink structure?

    Thread Starter Aishwarya Taneja

    (@aishwaryataneja85)

    Oh. ??

    The plugin will make use of the custom permalink structure and that structure can be anything.

    Thread Starter Aishwarya Taneja

    (@aishwaryataneja85)

    Nevermind. I found another plugin which allows to use custom permalinks.

    Thanks anyways.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Make changes to the post.php file in WP Core’ is closed to new replies.