Last active
June 18, 2022 10:35
-
-
Save Codevz/125bad1132cf7138e1f8f96ed5b0f8a2 to your computer and use it in GitHub Desktop.
XTRA WP Theme - Action hook for adding content before any post types archive pages, https://xtratheme.com/
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 | |
/** | |
* With this function you can add any content or php codes before post type archive pages. | |
* | |
* @var $post_type will return current post type name | |
*/ | |
function my_prefix_before_archive( $post_type ) { | |
if ( $post_type === 'portfolio' ) { | |
echo 'This content will show up before portfolio posts.'; | |
} | |
} | |
add_action( 'codevz/archive/before', 'my_prefix_before_archive' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you want to see more actions and hooks of XTRA WP theme, Please check out documentation here https://xtratheme.com/docs/developer/