Advertisement
marjwyatt

wsk do shortcode

Oct 3rd, 2012
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.18 KB | None | 0 0
  1. <?php /*
  2. Template Name: Test Accordion IV
  3. */
  4. // ref link http://www.kimwoodbridge.com/wordpress-how-to-list-recent-posts-from-one-category/
  5. // wordpress support link http://wordpress.org/support/topic/do_shortcode-on-closing-isnt-working?replies=3
  6. get_header();
  7. /** Register default layout setting */
  8. ?>
  9. <?php genesis_before_content_sidebar_wrap(); ?>
  10.     <div id="content-sidebar-wrap">
  11.     <?php genesis_before_content(); ?>
  12.     <div id="content" class="hfeed">
  13.     <?php $shrt_cd = "[accordion title='Menus & Parties']";
  14.         query_posts( array ( 'category_name' => 'menus-parties', 'posts_per_page' => '-1' ) );
  15.         $shrt_cd .= '<ul>';
  16.         while (have_posts()) : the_post();
  17.                 $shrt_cd .= '<li><a href="'.get_permalink().'">';
  18.                 $shrt_cd .= get_the_title();
  19.                 $shrt_cd .= '</a></li>';
  20.         endwhile;
  21.         $shrt_cd .= '</ul>';
  22.         $shrt_cd .= "[/accordion]";
  23.         echo do_shortcode( $shrt_cd );
  24.     wp_reset_query(); ?>
  25.     </div> <!-- end #content -->
  26.     <?php genesis_after_content(); ?>
  27.     </div> <!-- end #content-sidebar-wrap -->
  28. <?php genesis_after_content_sidebar_wrap(); ?>
  29.  
  30.  
  31. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement