Category Pages

You are here:
p

Notice

This article is intended for developers. Coding experience is require, support is not provided at this level of customization.

Before doing any custom work. Always backup your website and create a child theme to add custom code. See this article on how to create child themes

Creating a custom archive page

Make a copy of the archive.php file from your active theme directory as a starting point and place the copy in your child theme. That way they will inherit some of the theme’s html structure.

Put this condition into your main block of html content.

if( get_post_type() == 'epkb_post_type_1' ){
echo 'This is my Custom code for this post type archive'; //Test to see if condition works.
} else {
// Run Regular archive for regular posts. Put the other archive code here from your regular archive file.
}

 

Last Updated On January 19, 2018