Custom Post Type Archive Template

Create a shortcode that generates a contact form.

<?php
function custom_post_type_archive_template($archive_template) {
    if (is_post_type_archive('portfolio')) {
        $archive_template = dirname(__FILE__) . '/archive-portfolio.php';
    }
    return $archive_template;
}
add_filter('archive_template', 'custom_post_type_archive_template');
?>

Post Comment