how to organize my categories or should I do custom post types for some?

I’d recommend going with a custom taxonomy, called “Semesters” (or “Quarter”, or “Issue”, or whatever makes sense in your context). You can then add “Fall 2012” and “Spring 2012” as Semesters, and assign posts to the relevant one. (If you’re not interested in editing code to set up the custom taxonomy, the Custom Post Type … Read more

display custom portfolio tags

You will need to know the name for your “portfolio_tags” taxonomy. Check where it is defined as a custom taxonomy, and it will need to be added to the portfolio custom post type. The register_taxonomy() function would be your theme like this: register_taxonomy(‘portfolio_tags’, array(‘portfolio’), array(‘hierarchical’ => false, ‘show_ui’ => true, ‘query_var’ => true, ‘rewrite’ => … Read more

How do I override the default number of items to be listed on an archive.php page? [duplicate]

You can hook into pre_get_posts and modify the query. Your hooked function will receive a WP_Query object as it’s only argument. You can check to see if you’re on a the correct post type archive and modify away. Something like this: <?php add_action(‘pre_get_posts’, ‘wpse63675_pre_posts’); function wpse63675_pre_posts($q) { if(!is_post_type_archive(‘your_album_type’)) return; $q->set(‘posts_per_page’, 20); // or however many … Read more

Adding link to dashboard sidebar, nested under custom post type

This should do it. function register_additional_page(){ add_submenu_page(‘edit.php?post_type=tree’, ‘Bulk Process’, ‘Bulk Process’, ‘activate_plugins’, ‘tree_bulk_process’, ‘render_bulk_tree_process’); } add_action(‘admin_menu’, ‘register_additional_page’); And the function that renders the page. function render_voucher_list_page(){ ?> <h2>Hello World</h2> <?php } Change post_type=tree to your Custom Post Type, Bulk Process to the menu title, activate_plugins to your desired user capability, tree_bulk_process to your page ‘slug’ … Read more

Custom field with Types: get custom field’s value label (of type select)

Just so you know, and after much code sniffing, I finally have a working solution : First, the custom field may start with wpcf- (for example: wpcf-custom-field). This prefix may be ignored and only the remaining characters kept. As in $customField = substr($fieldName, 5); // $fieldName=”wpcf-custom-field”; Now, the custom field data may be fetch via … Read more

Event Archive by Month

Ok short of a better solution here is what I’ve come up with: <?php $today = date(‘Y-m-d’, strtotime(‘-6 hours’)); query_posts(array( ‘post_type’ => ‘events’, ‘posts_per_page’ => 99, ‘meta_key’ => ‘event_date’, ‘orderby’ => ‘meta_value’, ‘order’ => ‘ASC’, ‘meta_query’ => array(array( ‘key’ => ‘event_date’, ‘meta-value’ => $value, ‘value’ => $today, ‘compare’ => ‘>=’, ‘type’ => ‘CHAR’ )) )); … Read more