Display content based on multiple URL parameters—pretty URL or query string

you have a little error in the call of add_rewrite_rule with an extra slash before index.php. with this correction, your system works without a CPT like data. you can try that : add_action(‘init’, function () { add_rewrite_rule( ‘^data/([a-z0-9-]+)/([a-z0-9-]+)/([a-z0-9-]+)/?$’, ‘index.php?data_type=$matches[1]&data_action=$matches[2]&data_post_id=$matches[3]’, ‘top’ ); }); add_action(“template_redirect”, function () { $data = []; foreach ([“data_type”, “data_action”, “data_post_id”] as $key) … Read more

How to change the url of the archive page to be inside the custom post type

The has_archive parameter for registering the post type should work (untested): register_post_type( ‘news’, array( … ‘has_archive’ => ‘news/all-news’, ‘rewrite’ => array( ‘slug’ => ‘news’, ‘with_front’ => false, ), ) ); Remember to flush the permalinks by going to Settings > Permalinks and clicking Save button.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)