Created
May 10, 2018 14:01
-
-
Save hwkdev/639944bc8bc21efcc31abf0958be1989 to your computer and use it in GitHub Desktop.
Revisions
-
hwkdev created this gist
May 10, 2018 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,28 @@ <?php // Taxonomy add_action('init', 'hwk_taxonomy_tax_example_register'); function hwk_taxonomy_tax_example_register() { register_taxonomy('tax_example', array('example'), array( 'label' => __('Tax Example'), 'hierarchical' => false, 'public' => true )); } // Args: Remove Single View add_filter('hwk/taxonomy/tax_example/args/no_single', '__return_true'); // Query add_filter('hwk/taxonomy/tax_example/query', 'hwk_taxonomy_tax_example_query'); function hwk_taxonomy_tax_example_query($query){ $query->set('posts_per_page', -1); $query->set('order', 'ASC'); return $query; } // Template add_filter('hwk/taxonomy/tax_example/template', 'hwk_taxonomy_tax_example_template'); function hwk_taxonomy_tax_example_template(){ return 'templates/tax_example/archive.php'; }