首页 文章

使文本显示在Alt主页上的静态图片滑块上方,并在Wordpress上使用静态滑块模板

提问于
浏览
0

基本上我正在使用Wordpress主题"Restaurateur"在Wordpress上创建一个网站 . 正如您在演示主页上看到的那样http://wprestaurateur.com/使用带有静态滑块模板的Alt主页,导航下方是图片滑块,然后是一些文本下方 . 我已经尝试了所有我能想到的没有运气的事情 . 有什么建议?谢谢 .

编辑:添加了用于主页的模板的.php文件 .

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

    <div id="main" class="clearfix sldr" role="main">

        <div id="slide-wrap">

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

        <div id="load-cycle"></div>
          <div class="cycle-slideshow alt-static" <?php 
                if ( get_theme_mod('restaurateur_slider_effect') ) {
                    echo 'data-cycle-fx="' . wp_kses_post( get_theme_mod('restaurateur_slider_effect') ) . '" data-cycle-tile-count="10"';
                } else {
                    echo 'data-cycle-fx="scrollHorz"';
                }
              ?> data-cycle-slides="> div.slides" <?php
                if ( get_theme_mod('restaurateur_slider_timeout') ) {
                    $slider_timeout = wp_kses_post( get_theme_mod('restaurateur_slider_timeout') );
                    echo 'data-cycle-timeout="' . $slider_timeout . '000"';
                } else {
                    echo 'data-cycle-timeout="3000"';
                }
              ?> >

        <div class="cycle-pager"></div>
        <?php while ( have_posts() ) : the_post(); ?>

        <?php if ( has_shortcode( $post->post_content, 'gallery' ) )  : ?>

            <?php 
            $gallery = get_post_gallery( $post, false );
            $ids = explode( ",", $gallery['ids'] );
            $hasgallery = 1;

            foreach( $ids as $id ) {
                $title = get_post_field('post_title', $id);
                $meta = get_post_field('post_excerpt', $id);
                $link = wp_get_attachment_url( $id );
                $image  = wp_get_attachment_image( $id, array( 1000, 640 ));    
            ?>

            <div class="slides">

              <div id="post-<?php the_ID(); ?>" <?php post_class('post-theme'); ?>>

                  <div class="slide-thumb"><?php echo $image; ?></div>

              </div>

            </div><!-- .slides -->  

            <?php } ?>

        <?php else : ?>

        <?php
           $args = array(
           'post_type' => 'attachment',
           'numberposts' => -1,
           'post_status' => null,
           'post_parent' => $post->ID,
           'orderby' => 'menu_order', 
           'order' => 'ASC'
          );

          $attachments = get_posts( $args );
             if ( $attachments ) {
                foreach ( $attachments as $attachment ) { ?>
                <div class="slides">
                  <div id="post-<?php the_ID(); ?>" <?php post_class('post-theme'); ?>>
                    <div class="slide-thumb"><?php echo wp_get_attachment_image( $attachment->ID, array( 1000, 640 ), false, '' ); ?></div>

                  </div>
                </div>
                  <?php }
             } else {
                 ?>
                 <div class="no-slide-image"><?php _e('Images added to this page will appear here', 'restaurateur'); ?></div>
                 <?php
             } ?>

        <?php endif; ?> 

        <?php endwhile; ?>

        </div>
        <?php endif; ?> 

        </div>

        <?php $content = restaurateur_content(9999); ?>
        <?php $content = preg_replace(array('{<a[^>]*><img}','{/></a>}'), array('<img','/>'), $content); ?>
        <?php $content = preg_replace('/<img[^>]+./', '', $content); ?>
        <?php $content = preg_replace('#<p>\s*+(<br\s*/*>)?\s*</p>#i', '', $content); ?>             
        <div class="intro-content">
            <?php echo $content; ?>
        </div>

    </div> <!-- end #main -->

</div> <!-- end #content -->

1 回答

  • 0

    好吧,我们需要看到您主页的php文件才能提供帮助 . 但是会有一个调用滑块的函数,你需要将它移动到文本内容区域下面 . 或者您可以自己在滑块功能之前添加一些文本 .

相关问题