Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/272.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/cmake/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何用滑块替换217个Wordpress标题?_Javascript_Php_Css_Wordpress - Fatal编程技术网

Javascript 如何用滑块替换217个Wordpress标题?

Javascript 如何用滑块替换217个Wordpress标题?,javascript,php,css,wordpress,Javascript,Php,Css,Wordpress,我想我的标题被替换为我的滑块与主滑块小部件。我希望滑块是全尺寸的,就像标题图像现在一样 这是标题代码: <?php ?><!DOCTYPE html> <html <?php language_attributes(); ?> class="no-js no-svg"> <head> <meta charset="<?php bloginfo( 'charset' ); ?>"> <meta name="v

我想我的标题被替换为我的滑块与主滑块小部件。我希望滑块是全尺寸的,就像标题图像现在一样

这是标题代码:

<?php
?><!DOCTYPE html>
<html <?php language_attributes(); ?> class="no-js no-svg">
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="profile" href="http://gmpg.org/xfn/11">

<?php wp_head(); ?>
</head>

<body <?php body_class(); ?>>
<div id="page" class="site">
<a class="skip-link screen-reader-text" href="#content"><?php _e( 'Skip to content', 'twentyseventeen' ); ?></a>

<header id="masthead" class="site-header" role="banner">
    <?php get_template_part( 'template-parts/header/header', 'image' ); ?>

    <?php if ( has_nav_menu( 'top' ) ) : ?>
        <div class="navigation-top">
            <div class="wrap">
                <?php get_template_part( 'template-parts/navigation/navigation', 'top' ); ?>
            </div><!-- .wrap -->
        </div><!-- .navigation-top -->
    <?php endif; ?>

</header><!-- #masthead -->

<?php
// If a regular post or page, and not the front page, show the featured image.
if ( has_post_thumbnail() && ( is_single() || ( is_page() && ! twentyseventeen_is_frontpage() ) ) ) :
    echo '<div class="single-featured-image-header">';
    the_post_thumbnail( 'twentyseventeen-featured-image' );
    echo '</div><!-- .single-featured-image-header -->';
endif;
?>

<div class="site-content-contain">
    <div id="content" class="site-content">


“仅首页…”您需要了解WordPress模板层次结构是如何工作的。查看
应该有效…@zipzit我应该把这个代码放在哪里?我需要删除任何其他代码吗?我把它插入了浏览器,但它什么也没做。你在使用Chrome浏览器中的开发者工具吗?源代码在浏览器中是什么样子的?在那条主滑杆线上?记住php函数都是从服务器调用的。JavaScript函数在用户浏览器中运行。尝试此
将此代码放在header.php文件中,就在
注意:让我们看看这是否有效。如果有,那么您必须添加一个php If语句来隐藏该首页上的其他内容。。。