March 2020
Beginner
660 pages
18h 28m
English
Follow these steps to create and load a custom template for user profiles through a custom route:
add_action('init','wpccp_chapter7_manage_user_routes');function wpccp_chapter7_manage_user_routes(){ add_rewrite_rule( '^user-profile/([^/]+)/?', 'index.php?wpcpp_user_id=$matches[1]', 'top' );}// Step 3 code should be placed after this line
add_filter( 'query_vars', 'wpccp_chapter7_manage_user_routes_query_vars' );function wpccp_chapter7_manage_user_routes_query_vars( ...
Read now
Unlock full access