Last active
June 18, 2022 10:35
-
-
Save Codevz/33a69e8b72ebc8373e5487273adefe9c to your computer and use it in GitHub Desktop.
XTRA WP Theme - Add content before archive content, 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 custom contetn, HTML, shortcode before any archive pages. | |
* | |
* @var $post_type post type slug | |
*/ | |
function my_prefix_before_archive_content( $post_type ) { | |
if ( $post_type === 'post' ) { | |
echo 'This is my custom content for posts archive ...'; | |
} else if ( $post_type === 'product' ) { | |
echo 'This is my custom content for WooCommerce archive ...'; | |
} | |
} | |
add_action( 'codevz_before_archive_content', 'my_prefix_before_archive_content' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment