List of all entries of custom-post-type: Add year-parameter?

I’ve modified above function somewhat function get_event_list( $latest = true, $order=”ASC”, $return = false, $year ) { // Pass year i.e $year $enddate = strtotime($year.”-12-31″); // year’s last date $startdate = strtotime( ($year-1).”-12-31″); year’s first date $yesterday = array($startdate, $enddate ); // Fetch posts between these dates $compare=”BETWEEN”;// Between above two dates $current_year=””; $args = … Read more

Can variables be used to rewrite a Custom Post Type permalink? [duplicate]

filter “pre_post_link” to change the permalink rule, the first attribute is the rule set to the administrator and the second is the element which is to form the link function my_pre_post_link( $permalink, $post, $leavename ) { // filtered by post_type, returns the format permalink if( $post->post_type != ‘book’ ) return ‘/bookis_custom/%postname%’; return $permalink; } add_filter( … Read more

List Posts By Custom Taxonomy

When you change URLs and post types/taxonomies, you need to flush and regenerate permalinks/rewrite rules to make the changes take effect. If you don’t, you’ll get 404 errors. You can do this by visiting the permalinks settings page. Your term will then be viewable at: /genre/fiction And take the template taxonomy-genre.php or taxonomy.php or archive.php … Read more