George Wiscombe
Forum Replies Created
Viewing 3 replies - 1 through 3 (of 3 total)
-
Forum: Themes and Templates
In reply to: Custom post type navigation listNot yet, i’ve got half a solution that can list custom post type pages and apply the correct style when they are active. But it’s a complete hack & I wouldn’t recommend using it.
This will create a list like this…
<?php $defaults = array( 'depth' => 1, 'title_li' => '', 'echo' => 1, 'exclude' => 6, 'sort_column' => 'menu_order, post_title', 'sort_order' => 'asc', 'link_before' => '', 'link_after' => ''); global $post, $wp_query; if (get_query_var('post_type') == 'shorts') { // Load up the 'Case Studies' page to fool WP. $page = get_page_by_title('Shorts'); $temp_post = $post; $temp_query = $wp_query; $wp_query = null; $wp_query = new WP_Query(); $wp_query->query(array('page_id' => $page->ID)); wp_list_pages($defaults); // Restore previous wp_query. $wp_query = null; $wp_query = $temp_query; $post = $temp_post; } else if (get_query_var('post_type') == 'features') { // Load up the 'Partners' page to fool WP. $page = get_page_by_title('Features'); $temp_post = $post; $temp_query = $wp_query; $wp_query = null; $wp_query = new WP_Query(); $wp_query->query(array('page_id' => $page->ID)); wp_list_pages($defaults); // Restore previous wp_query. $wp_query = null; $wp_query = $temp_query; $post = $temp_post; } else if (get_query_var('post_type') == 'musicvideos') { // Load up the 'Partners' page to fool WP. $page = get_page_by_title('Music Videos'); $temp_post = $post; $temp_query = $wp_query; $wp_query = null; $wp_query = new WP_Query(); $wp_query->query(array('page_id' => $page->ID)); wp_list_pages($defaults); // Restore previous wp_query. $wp_query = null; $wp_query = $temp_query; $post = $temp_post; } else if (get_query_var('post_type') == 'virals') { // Load up the 'Partners' page to fool WP. $page = get_page_by_title('Virals'); $temp_post = $post; $temp_query = $wp_query; $wp_query = null; $wp_query = new WP_Query(); $wp_query->query(array('page_id' => $page->ID)); wp_list_pages($defaults); // Restore previous wp_query. $wp_query = null; $wp_query = $temp_query; $post = $temp_post; } else { // A normal page. wp_list_pages($defaults); } ?>
The options at the top will change the output however most of the variables only apply to pages, not post-types. I believe it creates a list like this:
- Custom Post Type(s) – Alphabetical
- Pages – Alphabetical
Forum: Plugins
In reply to: Help with DB hook for Simple PluginBumping this as I’m still looking for help ??
Forum: Fixing WordPress
In reply to: Add Next and Previous Links with Images?Hi Vizion
That’s just a styling issue,#div-name img { border:none; }
should sort it out ??
Viewing 3 replies - 1 through 3 (of 3 total)