Do I need to flush rewrite rules when creating new user if using custom author rewrite rules?

Yes, you should flush rewrite rules in this case, because you add rules for every author based on his nicename. To be more precise, you should flush them after any author changes his nicename also. And you do this using author_rewrite_rules hook, which is fired in wp_rewrite_rules() only when there are no rules in database. … Read more

Custom Post Type won’t Register

“movie-special-features” is longer than 20 chars. If you enable debug, you will get a message, these names are not allowed longer than 20 cars. Reference: https://codex.wordpress.org/Function_Reference/register_post_type You can enable the debug mode in you wp-config.php with define( ‘WP_DEBUG’, true ); Reference: https://codex.wordpress.org/WP_DEBUG

Rewrite WordPress URL to show CPT meta field data

The post type query var is the same as the post type slug by default. Untested, but this should work- function custom_rewrite_basic() { add_rewrite_rule( ‘^books/([^/]+)/([0-9]+)/([^/]+)/?’, ‘index.php?books=$matches[1]&chapter=$matches[2]’, ‘top’ ); } add_action(‘init’, ‘custom_rewrite_basic’); $matches[3] will contain the chapter slug, but if you don’t need that to retrieve the chapter, then you don’t have to set it. Rewrite … Read more

Rewrite rule to prettify two $_GET variables while in a new endpoint from a page

I think you are using endpoints incorrectly. When a endopoint is created, a new rewrite rule is created using a query var with the same name of the endpoint; its value is taken from the string that follows the endpoint definition. So, if you register “my-endpoint” and build this URL: /page-slug/my-endpoint/123/some-string The endpoint is passed … Read more

Parent & Child Taxonomy slugs in custom post permalink

To handle the extra URL segment you need to add another rewrite rule similar to the one generated by add_permastruct, but with an extra capture group and slash for the additional level of terms: add_rewrite_rule( ‘book/([^/]+)/([^/]+)/([^/]+)-blah-blah-blah?(:/([0-9]+))?/?$’, ‘index.php?post_type=book&name=$matches[3]’, ‘top’ ); Also, as I mentioned in my comment, the query var and slug author are already in … Read more

Permalinks: Page Not Found

Do you have mod_rewrite enabled? This sort of thing tends to happen when it’s not. At which point, you only have access to ugly permalinks (?p=N) or “almost pretty” permalinks (/index.php/slug). The latter uses pathinfo to get you the page you’re requesting instead. So I’d suggest double checking whether mod_rewrite is installed and enabled. If … Read more

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