Skip to content

Instantly share code, notes, and snippets.

@Codevz
Last active June 18, 2022 10:35
Show Gist options
  • Save Codevz/125bad1132cf7138e1f8f96ed5b0f8a2 to your computer and use it in GitHub Desktop.
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/
<?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' );
@Codevz
Copy link
Author

Codevz commented Jan 16, 2022

If you want to see more actions and hooks of XTRA WP theme, Please check out documentation here https://xtratheme.com/docs/developer/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment