Custom Archive Page for Players
-
Hi, I used a sportspress filter to add an archive page to the “Player” custom post type:
<span style="background-color: rgb(33, 33, 33); color: rgb(238, 255, 255); font-family: Consolas, "Courier New", monospace; font-size: 14px; text-wrap: nowrap;">function display_archive_players( $post_args ) {</span>
? ? $post_args['has_archive'] = 'players';? ? return $post_args;}add_filter( 'sportspress_register_post_type_player', 'display_archive_players' );The code is working properly, but the /players archive page is getting the template from my archive.php file.
I’m using a child theme, I tried creating an archive-player.php template, I placed it inside the /sportspress folder I have with other templates, but it didn’t work. I also tried placing it on the root directory of my child theme, but it also didn’t work.
I don’t want to add the archive.php template in my child theme, since I want that one to be pulled from the parent theme and get the corresponding updates. How can I add the players archive to the child theme without overriding the archive.php template?
Thanks in advance ??
- The topic ‘Custom Archive Page for Players’ is closed to new replies.