0

一直在玩 Fullpage.js ( http://alvarotrigo.com/fullPage/ ) 和wordpress,这非常成功。该脚本非常棒,它使用了 html 结构,其中幻灯片容器内的 div 变成了水平幻灯片。

对于 wordpress,我有一个循环来获取页面以变成幻灯片,并且效果很好。但是,要创建放置在具有正确类的父容器内的页面似乎是我无法弄清楚的事情。感觉应该是可能的吗?如果有人对可以做我想要的循环有任何想法,我将不胜感激任何建议。

`

<?php

   if (($locations = get_nav_menu_locations()) && $locations['main-nav'] ) {
    $menu = wp_get_nav_menu_object( $locations['main-nav'] );
    $menu_items = wp_get_nav_menu_items($menu->term_id);
    $pageID = array();
    foreach($menu_items as $item) {
        if($item->object == 'page')
            $pageID[] = $item->object_id;
    }
query_posts( array( 'post_type' => 'page','post__in' => $pageID, 'posts_per_page' => count($pageID), 'orderby' => 'post__in' ) );
    }
    while(have_posts() ) : the_post();

    ?> 


   <!--     <div id="<?php echo $post->post_name;?>" class="section"> -->
 <div id="content2">
    <div id="pageSlide-<?php echo $post->post_name;?>" class="section" data-anchor="<?php echo $post->post_name;?>">

    <div id="content">

        <div id="inner-content" class="wrap clearfix">

            <div id="main" class="twelvecol first clearfix" role="main">

                <article id="post-<?php the_ID(); ?>" <?php post_class( 'clearfix' ); ?> role="article" itemscope itemtype="http://schema.org/BlogPosting">

                            <header class="article-header">

                                <h1 class="page-title"><?php the_title(); ?></h1>

                            </header>

                            <section class="entry-content clearfix" itemprop="articleBody">
                                <?php the_content(); ?>
                            </section>

                            <footer class="article-footer">
                                <p class="clearfix"><?php the_tags( '<span class="tags">' . __( 'Tags:', 'bonestheme' ) . '</span> ', ', ', '' ); ?></p>

                            </footer>

                </article>

            </div>

        </div>
    </div>

  </div> <!-- end of page div-->

 ?php endwhile;?> <!-- end of query -->

`

4

0 回答 0