wordpress - how to show category post and title separate loop -


i making 1 slider tab, know have tons of plugins don't want use plugins. want show category post title , post bellow html formate can't. tried my way content loop not title. if can able make html bellow tabs work. guys how can that.

    <ul class="tabs">     <li><a href="#content_1" rel="tab_1" class="tab active_tab">tabs 1</a></li>     <li><a href="#content_2" rel="tab_2" class="tab">tabs 2</a></li>     <li><a href="#content_3" rel="tab_3" class="tab">tabs 3</a></li>     <li><a href="#content_4" rel="tab_4" class="tab">tabs 4</a></li>     <li><a href="#content_5" rel="tab_5" class="tab">tabs 5</a></li>     </ul>  here under li (tabs) put post title      <div id="content_1" class="tab_view first_tab">                     <h2>tab #1</h2>                         <p>lorem ipsum dolor sit amet, duis netus ut posuere feugiat arcu, purus wisi quis fringilla at, nunc ut eget elit duis erat praesent, ut fermentum lacus turpis cras. justo gravida erat quam mauris purus, aliquam quisque, eget nisl. pellentesque nibh duis odio morbi quam, scelerisque convallis aenean quam tincidunt ornare nam nec feugiat sodales tristique.</p>                                          </div>  <div id="content_1" class="tab_view first_tab">                     <h2>horizontal tab #1</h2>                         <p>lorem ipsum dolor sit amet, duis netus ut posuere feugiat arcu, purus wisi quis fringilla at, nunc ut eget elit duis erat praesent, ut fermentum lacus turpis cras. justo gravida erat quam mauris purus, aliquam quisque, eget nisl. pellentesque nibh duis odio morbi quam, scelerisque convallis aenean quam tincidunt ornare nam nec feugiat sodales tristique.</p>                                          </div> <div id="content_1" class="tab_view first_tab">                     <h2>horizontal tab #1</h2>                         <p>lorem ipsum dolor sit amet, duis netus ut posuere feugiat arcu, purus wisi quis fringilla at, nunc ut eget elit duis erat praesent, ut fermentum lacus turpis cras. justo gravida erat quam mauris purus, aliquam quisque, eget nisl. pellentesque nibh duis odio morbi quam, scelerisque convallis aenean quam tincidunt ornare nam nec feugiat sodales tristique.</p>                                          </div> <div id="content_1" class="tab_view first_tab">                     <h2>horizontal tab #1</h2>                         <p>lorem ipsum dolor sit amet, duis netus ut posuere feugiat arcu, purus wisi quis fringilla at, nunc ut eget elit duis erat praesent, ut fermentum lacus turpis cras. justo gravida erat quam mauris purus, aliquam quisque, eget nisl. pellentesque nibh duis odio morbi quam, scelerisque convallis aenean quam tincidunt ornare nam nec feugiat sodales tristique.</p>                                          </div><div id="content_1" class="tab_view first_tab">                     <h2>horizontal tab #1</h2>                         <p>lorem ipsum dolor sit amet, duis netus ut posuere feugiat arcu, purus wisi quis fringilla at, nunc ut eget elit duis erat praesent, ut fermentum lacus turpis cras. justo gravida erat quam mauris purus, aliquam quisque, eget nisl. pellentesque nibh duis odio morbi quam, scelerisque convallis aenean quam tincidunt ornare nam nec feugiat sodales tristique.</p>                                          </div> 

see closely href="#content_1" rel="tab_1" #content_ (1,2,3,4,5)should auto. similar <div id="content_1" content_ number auto mean post number

you can try

     $args = array( 'post_type' => array('post'),  'orderby' => 'post_date', 'category_name'=>'my category name' , 'showposts' => 5 ); $array= get_posts($args); ?> <ul class="tabs">  ($i = 0; $i < count($array); $i++) { ?>     <li><a href="#content_<?php echo $i+1; ?>" rel="tab_<?php echo $i+1; ?>" class="tab">tabs   <?php echo $i+1; ?></a></li>  <?php $divs.='<div id="content_'.($i+1).'" class="tab_view first_tab"> <h2>'.$array[$i]->post_title.'</h2> <p>'.$array[$i]->post_content.'</p>                                          </div>';      } ?>  </ul>  <?php $divs; ?> 

Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -