• Hi everybody,

    I would like to make tabbed posts. For exemple, there will be the title, then the date, after, the tabbed menu and the content. Under, the tags and so on.
    The content of the tabs will be the post, a gallery and and other stuff i didn’t decide what.

    I found a great script using CSS and JS, Tbatastic. (https://phrogz.net/JS/Tabtastic/index.html)
    So I tried to adapt the code to WordPress…
    I put the the_post() in a content area, it works but tabs doesnt work and that pretty weird.

    Here is my code :

    <?php get_header(); ?>

    <div id="content" class="narrowcolumn">

    <?php if (have_posts()) : ?>

    <div class="post" id="post-<?php the_ID(); ?>">

    <h2>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></h2>

    <small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> -->
    </small>
    </div>
    <------TABS CODE------>
    <ul class="tabset_tabs">

    • 1" class="active">Article
    • 2">Tab 2
    • 3">Tab 3
    • <div id="tab<?php the_ID(); ?>1" class="tabset_content">
      <h2 class="tabset_label">Article</h2>
      <?php while (have_posts()) : the_post(); ?>
      </div>

      <div id="tab<?php the_ID(); ?>2" class="tabset_content">
      <h2 class="tabset_label">Tab 2</h2>
      Tab 2 Content
      </div>

      <div id="tab<?php the_ID(); ?>3" class="tabset_content">
      <h2 class="tabset_label">Tab 3</h2>
      Tab 3 Content
      </div>
      <------TABS CODE------>

      See the result : https://www.bab.fr.nf (blog dedicated to tests)

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Tabbed posts’ is closed to new replies.