[Plugin: Press, News, Events] Cannot Create Lists of Posts
-
I am coding a “tabber” in the sidebar. The tabber has three tabs, one for each custom post type created by the plugin. I cannot get the tabber to list the press and events posts. Here is what one of my advisors gave me …
(1) Added to theme functions
function tj_tabs_news($posts = 5) { $news = query_posts( array( 'post_type' => 'news', 'posts_per_page' => $posts ) ); while ( have_posts() ) : the_post(); ?> <li> <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3> <div class="clear"></div> </li> <?php endwhile; } function tj_tabs_press($posts = 5) { $news = query_posts( array( 'post_type' => 'press-releases', 'posts_per_page' => $posts ) ); while ( have_posts() ) : the_post(); ?> <li> <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3> <div class="clear"></div> </li> <?php endwhile; } function tj_tabs_events($posts = 5) { $news = query_posts( array( 'post_type' => 'events', 'posts_per_page' => $posts ) ); while ( have_posts() ) : the_post(); ?> <li> <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3> <div class="clear"></div> </li> <?php endwhile; }
Code in the tabber sidebar …
<?php if (get_theme_mod('tabber') == 'Yes') { ?> <div class="tabber"> <ul id="tabs" class="tabs"> <li><a href="#news" rel="news" class="selected"><?php _e('News', 'themejunkie'); ?></a></li> <li><a href="#press" rel="press"><?php _e('Press', 'themejunkie'); ?></a></li> <li><a href="#events" rel="events"><?php _e('Events', 'themejunkie'); ?></a></li> </ul> <div class="clear"></div> <ul id="news" class="tabcontent"> <h2><center><b><a href="<?php bloginfo('url'); ?>/news/">Click Here To See More About Us In The News!</a></b></center></h2> <br /> <?php tj_tabs_news(); ?> </ul> <ul id="press" class="tabcontent"> <h2><center><b><a href="<?php bloginfo('url'); ?>/press/">Click Here To See What's Coming Up!</a></b></center></h2> <br /> <?php tj_tabs_press(); ?> </ul> <ul id="events" class="tabcontent"> <h2><center><b><a href="<?php bloginfo('url'); ?>/events/">Click Here To See What's Coming Up!</a></b></center></h2> <br /> <?php tj_tabs_events(); ?> </ul> <script type="text/javascript"> var tabs=new ddtabcontent("tabs") tabs.setpersist(false) tabs.setselectedClassTarget("link") tabs.init() </script> </div> <!--end: tabber--> <div class="clear"></div> <?php } ?>
Can you tell us what we did wrong in trying to list the press-releases and events posts?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘[Plugin: Press, News, Events] Cannot Create Lists of Posts’ is closed to new replies.