Skip to content

Instantly share code, notes, and snippets.

@isuke01
Created September 7, 2018 10:39

Revisions

  1. isuke01 created this gist Sep 7, 2018.
    12 changes: 12 additions & 0 deletions tempalte_override.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    <?php

    add_filter( 'template_include', 'archives_overrides', 99 );
    function archives_overrides( $template ) {
    global $post;
    if(!$post){ return $template; }
    if ( $post->ID == get_archive_for_projects() ) {
    $new_template = locate_template( array( 'template-projects.php' ) );
    if ( '' != $new_template ) { return $new_template ; }
    }
    return $template;
    }