我的网站是http://www.edumuffin.com/(hompage)

本网站使用Listify WordPress主题构建 .

我想在主页上有一个滑块,我正在使用插件Slider Revolution . 问题是我希望滑块代替英雄形象,搜索位于顶部 . 主题有多个页面模板; the homepage uses the template as below:

<?php
/**
 * Template Name: Page: Home
 *
 * @package Listify
 */

if ( ! listify_has_integration( 'wp-job-manager' ) ) {
	return locate_template( array( 'page.php' ), true );
}

get_header(); ?>

	<?php while ( have_posts() ) : the_post(); ?>

		<?php $style = get_post()->hero_style; ?>

		<?php if ( 'none' !== $style ) : ?>

			<?php if ( in_array( $style, array( 'image', 'video' ) ) ) : ?>

			<div <?php echo apply_filters( 'listify_cover', 'homepage-cover page-cover entry-cover entry-cover--home entry-cover--' . get_theme_mod( 'home-hero-overlay-style', 'default' ), array( 'size' => 'full' ) ); ?>>
				<div class="cover-wrapper container">
					<?php
						the_widget(
							'Listify_Widget_Search_Listings',
							apply_filters( 'listify_widget_search_listings_default', array(
								'title' => get_the_title(),
								'description' => strip_shortcodes( get_the_content() )
							) ),
							array(
								'before_widget' => '<div class="listify_widget_search_listings">',
								'after_widget'  => '</div>',
								'before_title'  => '<div class="home-widget-section-title"><h1 class="home-widget-title">',
								'after_title'   => '</h1></div>',
								'widget_id'     => 'search-12391'
							)
						);
					?>
				</div>

				<?php
					if ( 'video' == $style ) :
						wp_reset_query();

						add_filter( 'wp_video_shortcode_library', '__return_false' );
						
						the_content();

						remove_filter( 'wp_video_shortcode_library', '__return_false' );
					endif;
				?>
			</div>

			<?php else : ?>

				<div class="homepage-cover has-map">
					<?php
						do_action( 'listify_output_map' );

						if ( ! is_active_widget( false, false, 'listify_widget_map_listings', true ) ) {
							do_action( 'listify_output_results' );
						}
					?>
				</div>

			<?php endif; ?>

		<?php endif; ?>

		<?php do_action( 'listify_page_before' ); ?>

		<div class="container homepage-hero-style-<?php echo $style; ?>">

			<?php if ( listify_has_integration( 'woocommerce' ) ) : ?>
				<?php wc_print_notices(); ?>
			<?php endif; ?>

			<?php
				if ( is_active_sidebar( 'widget-area-home' ) ) :
					dynamic_sidebar( 'widget-area-home' );
				else :
					$defaults = array(
						'before_widget' => '<aside class="home-widget">',
						'after_widget'  => '</aside>',
						'before_title'  => '<div class="home-widget-section-title"><h3 class="home-widget-title">',
						'after_title'   => '</h3></div>',
						'widget_id'     => ''
					);

					the_Widget(
						'Listify_Widget_Recent_Listings',
						array(
							'title' => __( 'Recent  Listings', 'listify' ),
							'description' => __( 'Take a look at what\'s been recently added.', 'listify' ),
							'limit' => 6,
							'featured' => 0
						),
						$defaults
					);
				endif;
			?>

		</div>

	<?php endwhile; ?>

<?php get_footer(); ?>

提供了一个模板,可用于使用短代码添加滑块 . 我使用的短代码是[rev_slider alias = "slider1"] . 点击此处查看页面http://www.edumuffin.com/test-page/

The template which this page uses is as below:

<?php
/**
 * Template Name: Page: Home (Slider 2)
 *
 * @package Listify
 */

if ( ! listify_has_integration( 'wp-job-manager' ) ) {
	return locate_template( array( 'page.php' ), true );
}

get_header(); ?>

	<?php while ( have_posts() ) : the_post(); ?>

		<?php the_content(); ?>

		<?php do_action( 'listify_page_before' ); ?>

		<div class="container">

			<?php if ( listify_has_integration( 'woocommerce' ) ) : ?>
				<?php wc_print_notices(); ?>
			<?php endif; ?>

			<?php dynamic_sidebar( 'widget-area-page-' . get_the_ID() ); ?>

		</div>

	<?php endwhile; ?>

<?php get_footer(); ?>

虽然我仍然可以在此页面添加小部件以获取我的网站主页中的内容,但搜索仍然不会出现 .

我想在我的主页上的测试页面中显示滑块,滑块顶部的搜索完好无损 .

“旋转”滑块提供以下用于嵌入滑块的代码:

Advanced Embeding 从主题html使用:

<?php putRevSlider( 'slider1' ); ?>

要仅将滑块添加到主页,请使用:

<?php putRevSlider('slider1', 'homepage'); ?>

要在特定页面或帖子上添加滑块,请使用:

<?php putRevSlider('slider1', '2,10'); ?>

任何帮助将受到高度赞赏 .