• Resolved taka1

    (@taka1)


    プラグインを有効化すると、元々あるchartというディレクトリにある投稿記事が全て404エラーとなります。

    ディレクトリ名を変更することはできません。

    解決方法はありますか?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author methnen

    (@methnen)

    I don’t speak or read Japanese so apologies if google translate didn’t do a good job.

    But I think the problem you describe is the M Chart post_type slug conflicting with an existing one in your install of WordPres.

    You can override slugs and any other post type arguments using the following filter hook:

    register_post_type_args

    In practice this looks something like this:

    add_filter( 'register_post_type_args', 'm_chart_register_post_type_args', 10, 2 );
    
    /**
     * Filter register_post_type_args and modify it for our purposes
     */
    public function register_post_type_args( $args, $post_type ) {
    	if ( 'm-chart' == $post_type ) {
    		$args['rewrite']['slug'] = 'something-other-than-chart-here';
    	}
    
    	return $args;
    }

    This should work as is if you throw it into your functions.php file and change the something-other-than-chart-here to what you’d prefer M Chart to use instead of chart for individual chart URLs.

    Plugin Author methnen

    (@methnen)

    Oh, and depending on what kind of caching you’ve got going on you might need to hit the Settings -> Permalinks page in the admin panel to make sure any rewrite rules have been refreshed.

    Thread Starter taka1

    (@taka1)

    I apologize for posting without translating it.
    Thank you for letting me know the solution.
    thank you very much.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.