Help with rewrite rules for two post types

The first rule is capturing all requests. If you add a $ anchor at the end of the rules, they’ll behave as expected (you could also just switch the order of the rules so the more specific one “wins”). add_rewrite_rule( ‘^app/course/([^/]+)/?$’, ‘index.php?page_id=3400&course=matches[1]’, ‘top’ ); add_rewrite_rule( ‘^app/course/([^/]+)/theme/([^/]+)/?$’, ‘index.php?page_id=3400&course=$matches[1]&theme=$matches[2]’, ‘top’ ); Check out Monkeyman Rewrite Analyzer for … Read more

Can’t get custom rewrite tag, query var, permastruct (permalink structure), and rewrite rule to work properly together

After a lot of inspection of rewrites happening under the hood by hooking into filters and logging variable values, I managed to solve the problem! Queries and query rewriting When a query occurs, WordPress will serve the content using the correct template as soon as it has enough info to unambiguously determine what the template … Read more

404 Issue w/ Custom Post Type – using Meta for Permalink rewrite

Indeed, you need to add the rewrite tags. They indicate what can come in the place of your %cal_year% and similar tags: add_rewrite_tag( ‘%cal_year%’, ‘([0-9]{4})’ ); add_rewrite_tag( ‘%cal_month%’, ‘([0-9]{1,2})’ ); add_rewrite_tag( ‘%cal_day%’, ‘([0-9]{1,2})’ ); This works, but I don’t understand how: it seems to me something is missing to let WordPress know how it should … Read more

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