Created
June 22, 2023 22:41
-
-
Save everaldomatias/b25ff3ea99b708d6738a3c5314b3b40e to your computer and use it in GitHub Desktop.
Altera o `excerpt_more` na Home e para o CPT `deputado`
This file contains 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 | |
function filter_excerpt_more( $more ) { | |
global $post; | |
if ( is_front_page() ) { | |
if ( ! ( 'deputado' == $post->post_type ) ) { | |
return $more; | |
} | |
$read_more_text = '[...]'; | |
return ' <a href="'. get_permalink( $post->ID ) . '">' . $read_more_text . '</a>'; | |
} | |
return $more; | |
} | |
add_filter( 'excerpt_more', 'filter_excerpt_more', 100 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment