Created
May 10, 2018 14:01
-
-
Save hawkidoki/639944bc8bc21efcc31abf0958be1989 to your computer and use it in GitHub Desktop.
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 | |
// 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'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment