Add variables from rewrite rules to query var

I wasn’t linking to the page correctly in the rewrite rules. The use of pagename was incorrect instead I should have used page_id. The rewrite rules I ended up using was add_rewrite_rule(‘^resa/start/?$’, ‘index.php?page_id=1897&route_page=start’, ‘top’); add_rewrite_rule(‘^resa/planera/?$’, ‘index.php?page_id=1897&route_page=plan’, ‘top’); add_rewrite_rule(‘^resa/dela/([^/]+)/?$’,’index.php?page_id=1897&route_page=share&share_id=$matches[1]’, ‘top’);

How can replace this url

Do you mean you want to create a php string that will output the first code example? If yes than you can do this echo ‘<td><a href=”‘ . $this->get_user_link($user->ID) . ‘”>’ . esc_html__(‘View Profile’, ‘wpuf-pro’ ) . ‘</a></td>’;

Custom Endpoint For Specific Custom Post Type

I noticed that your post type is hierarchical, so you could actually add page-attributes to the supports array in your post type args, i.e. ‘supports’ => array(‘title’, ‘editor’, ‘thumbnail’, ‘page-attributes’), then you could create those sub-sections as child of your movie posts. But yes, the child posts will need to use unique slugs like news, … Read more