Site icon Hip-Hop Website Design and Development

add_rewrite_rule() challenge with mum or dad/little one/little one web page

I’ve a mum or dad/little one and one other mum or dad/little one/little one pages. I’ve 2 separate web page templates for each pages and the next add_rewrite_rule() code in place:

add_rewrite_rule( '^consumer/dashboard/([^/]*)/?’, 'index.php?pagename=consumer/dashboard&profile=$matches[1]', 'high' );

add_rewrite_rule( '^consumer/dashboard/billing/([^/]*)/?’, 'index.php?pagename='consumer/dashboard/billing&profile=$matches[1]', 'high' );

The primary one (i.e. mum or dad/little one) works wonderful however the 2nd one (i.e mum or dad/little one/little one) shouldn’t be working. That means after I go to the mum or dad/little one/little one web page, it’s utilizing the template of the mum or dad/little one web page and never the one assigned to itself.

If I remark out the primary add_rewrite_rule() line, it really works as anticipated. Looks like the primary one is overriding the 2nd one.

I’ve tried flushing the rewrite guidelines manually by going to settings > permalinks.

I’ve even tried to vary the order of the rewriting guidelines i.e. I attempted registering the mum or dad/little one/little one path earlier than mum or dad/little one rule after which flushed the foundations manually. However that additionally did not assist.

Any assistance is appreciated.