Customized wp_get_archives Link
-
Hi everybody,
I’m getting my yearly based custom-post-type archive like this:
$args = array ( 'type' => 'yearly', 'post_type' => 'project', 'format' => 'custom', 'before' => '<li value="2016" data-filter-value=".classof2016">', 'after' => '</li>' ); wp_get_archives($args); ?>
I altered the function in function.php, so that I can parse my custom post types like this:
function my_custom_post_type_archive_where($where,$args){ $post_type = isset($args['post_type']) ? $args['post_type'] : 'post'; $where = "WHERE post_type = '$post_type' AND post_status = 'publish'"; return $where; } add_filter( 'getarchives_where','my_custom_post_type_archive_where',10,2);
As you can see, I’m creating a value that should be related to the year. How can I add this term in the html?
Thanks for your help!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Customized wp_get_archives Link’ is closed to new replies.