Last active
September 25, 2025 23:18
-
-
Save amboutwe/d51f6beae6d81a5fecd04d726dd69f46 to your computer and use it in GitHub Desktop.
Revisions
-
amboutwe revised this gist
Jan 30, 2024 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,6 +4,8 @@ /* Include authors of CPTs in the Yoast author sitemap * Credit: Yoast team * Last Tested: Jan 29 2024 using Yoast SEO 21.9.1 on WordPress 6.4.2 * For optimial SEO, please ensure that CPT posts are included in the core author archive output * Example: https://wpdevdesign.com/how-to-add-cpt-entries-in-author-archives/ */ add_filter( 'wpseo_author_archive_post_types', 'yoast_seo_sitemap_add_cpt_authors'); -
amboutwe created this gist
Jan 30, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ <?php /********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/ /* Include authors of CPTs in the Yoast author sitemap * Credit: Yoast team * Last Tested: Jan 29 2024 using Yoast SEO 21.9.1 on WordPress 6.4.2 */ add_filter( 'wpseo_author_archive_post_types', 'yoast_seo_sitemap_add_cpt_authors'); function yoast_seo_sitemap_add_cpt_authors ( $currentPostTypes ) { $addPostTypes = []; // Do not remove this line array_push( $addPostTypes, "book" ); // Repeat to add another post type array_push( $addPostTypes, "movie" ); // Repeat to add another post type //Do not remove the lines below $newPostTypeArray = array_unique( array_merge( $currentPostTypes, $addPostTypes )); return $newPostTypeArray; }