Improve Custom Post Permalink Structure

you can use and manage your permalink for custom post type. Custom Post Type Permalinks add_action(‘init’, ‘my_rewrite’); function my_rewrite() { global $wp_rewrite; $wp_rewrite->add_permastruct(‘typename’, ‘typename/%year%/%postname%/’, true, 1); add_rewrite_rule(‘typename/([0-9]{4})/(.+)/?$’, ‘index.php?typename=$matches[2]’, ‘top’); $wp_rewrite->flush_rules(); // !!! }

How to properly use Categories with Custom Post Types

Your get_posts call needs a posts_per_page argument if you want more than whatever the default number per page is. Use -1 to retrieve all matching posts. $featured_posts = get_posts( array( ‘post_type’ => array( ‘post’, ‘books’, ‘cds’, ‘maps’ ), ‘category’ => get_theme_option(‘featured_posts_category’), ‘posts_per_page’ => -1 ) );

Looking up custom taxonomy IDs by name

I just ran a quick test on a site that uses custom taxonomies. The sample code that you used works for me. I did the following $test_term_by = get_term_by(‘name’, ‘Sample Name’, ‘my-custom-taxonomy’); // note that this produces a “stdclass object”, not an array. echo ‘<pre>’; print_r($test_term_by); echo ‘</pre>’; echo $test_term_by->term_taxonomy_id; // one of the values … Read more