Dynamiczne zakładki
-
Witam, próbuje stworzyć wyświetlanie zawartości podstron w dynamicznych zakładkach, które są pobrane z menu rodzica.
1. Menu
a)submenu
b)submenu2
c)submenu3Zakładki
submenu | submenu2 | submenu3
po wybraniu wyświetla się dana zawartość strony
kod php:
<?php /* Template Name: Submenu Page Tabs */ ?> <?php $args = array( 'post_parent' => $post->ID, 'post_type' => 'page', 'orderby' => 'menu_order', 'posts_per_page' => 8 ); $child_query = new WP_Query( $args ); ?> <?php get_header(); ?> <div id="content"> <?php get_sidebar(); ?> <div id="content-right"> <div id="tab-container" class='tab-container page_submenu'> <?php while ( $child_query->have_posts() ) : $child_query->the_post(); ?> <ul class='etabs'> <li class='tab'><a href="#<?php echo get_the_ID(); ?> " rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a> </li> </ul> <?php endwhile; ?> <?php wp_reset_query();?> <div class='panel-container'> <?php get_template_part('loop','page','tabs');?> </div> </div> </div> <?php get_footer(); ?>
Pętla:
<div id="<?php echo get_the_ID(); ?> "> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <div class="article-featured"> <p class="article-featured-date"><?php the_time('d/m/Y'); ?></p> <div class="article-header"> <div class="article-picture_box"> <a href="<?php the_permalink(); ?>"> <?php if ( has_post_thumbnail() ) { the_post_thumbnail( 'single-post', array('class' => 'article-picture') ); } ?> </a> </div> <h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1> </div> <div class="article-featured-text"> <?php the_content(); ?> </div> <div class="article-featured-share"> <!--<span>Podziel się informacją:</span> <img src="<?php #bloginfo( 'template_url' ); ?>/images/share.png" style="position: relative; left: 10px; top: 8px; cursor: pointer;"> --></div> </div> <?php endwhile; else: ?> <?php endif; ?> </div>
chce uzyskać taki efekt:
Dynamicze zakladki
- Temat ‘Dynamiczne zakładki’ jest zamknięty na nowe odpowiedzi.