Created
January 28, 2022 21:11
-
-
Save brettkelly/57a13f02b7531e54c5a256ef4f36fd4c to your computer and use it in GitHub Desktop.
Override the archive title for a CPT in Elementor Pro
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 characters
<?php | |
// ganked this from a FB group thread that linked to a dead E doc page. | |
// Storing here for reference/posterity. | |
function archive_callback( $title ) { | |
// make this a switch if you want to handle a bunch of different CPTs in one go | |
if ( is_post_type_archive('my_cpt_slug') ) { | |
return 'My custom archive title, baybay'; | |
} | |
return $title; | |
} | |
add_filter( 'elementor/utils/get_the_archive_title','archive_callback' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment