How to assign php file(template) to several pages with same prefix page name/slug
How about this? For PHP 8 (faster) if ( str_contains( get_post_field( ‘post_name’ ), ‘activity’) ) { get_template_part( ‘activity’ ); } For older versions of PHP if ( strpos(get_post_field( ‘post_name’ ), ‘activity’) !== false ) { get_template_part( ‘activity’ ); }