Skip to content

Instantly share code, notes, and snippets.

@csalzano
Last active March 16, 2021 18:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save csalzano/3aef155acdf6a6a9bc5d4e7fa8b50067 to your computer and use it in GitHub Desktop.
Save csalzano/3aef155acdf6a6a9bc5d4e7fa8b50067 to your computer and use it in GitHub Desktop.
Change which template is served in a Twenty Twenty-One child theme to incorporate wporg-developer
<?php
//In single.php of twentytwentyone theme, find this line
get_template_part( 'template-parts/content/content-single' );
//and replace it with this condition to blend the code reference features of the wporg-developer theme
if( DevHub\is_parsed_post_type() )
{
get_template_part( 'content', 'reference' );
}
else
{
get_template_part( 'template-parts/content/content-single' );
}
//learn more https://coreysalzano.com/wordpress/mimic-the-wordpress-org-developer-reference/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment