更新-问题中的header.php :问题是:在哪里添加新行
<?php
echo do_shortcode("[metaslider id=36]"); ?>目前我不知道该往哪里加.
<?php
// Exit if accessed directly
if( !defined( 'ABSPATH' ) ) {
exit;
}
/**
* Header Template
*
*
* @file header.php
* @package Responsive
* @author Emil Uzelac
* @copyright 2003 - 2014 CyberChimps
* @license license.txt
* @version Release: 1.3
* @filesource wp-content/themes/responsive/header.php
* @link http://codex.wordpress.org/Theme_Development#Document_Head_.28header.php.29
* @since available since Release 1.0
*/
?>
<!doctype html>
<!--[if !IE]>
<html class="no-js non-ie" <?php language_attributes(); ?>> <![endif]-->
<!--[if IE 7 ]>
<html class="no-js ie7" <?php language_attributes(); ?>> <![endif]-->
<!--[if IE 8 ]>
<html class="no-js ie8" <?php language_attributes(); ?>> <![endif]-->
<!--[if IE 9 ]>
<html class="no-js ie9" <?php language_attributes(); ?>> <![endif]-->
<!--[if gt IE 9]><!-->
<html class="no-js" <?php language_attributes(); ?>> <!--<![endif]-->
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?php wp_title( '|', true, 'right' ); ?></title>
<link rel="profile" href="http://gmpg.org/xfn/11"/>
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>"/>
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<?php responsive_container(); // before container hook ?>
<?php echo do_shortcode("[metaslider id=85]"); ?>
<div id="container" class="hfeed">
<?php responsive_header(); // before header hook ?>
<div id="header">
<?php responsive_header_top(); // before header content hook ?>
<?php if( has_nav_menu( 'top-menu', 'responsive' ) ) { ?>
<?php wp_nav_menu( array(
'container' => '',
'fallback_cb' => false,
'menu_class' => 'top-menu',
'theme_location' => 'top-menu'
)
);
?>
<?php } ?>
<?php responsive_in_header(); // header hook ?>
<?php if( get_header_image() != '' ) : ?>
<div id="logo">
<a href="<?php echo home_url( '/' ); ?>"><img src="<?php header_image(); ?>" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="<?php bloginfo( 'name' ); ?>"/></a>
</div><!-- end of #logo -->
<?php endif; // header image was removed ?>
<?php if( !get_header_image() ) : ?>
<div id="logo">
<span class="site-name"><a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></span>
<span class="site-description"><?php bloginfo( 'description' ); ?></span>
</div><!-- end of #logo -->
<?php endif; // header image was removed (again) ?>
<?php if( !get_header_image() ) : ?>
<div id="logo">
</div><!-- end of #logo -->
<?php endif; // header image was removed (again) ?>
<?php get_sidebar( 'top' ); ?>
<?php wp_nav_menu( array(
'container' => 'div',
'container_class' => 'main-nav',
'fallback_cb' => 'responsive_fallback_menu',
'theme_location' => 'header-menu'
)
);
?>
<?php if( has_nav_menu( 'sub-header-menu', 'responsive' ) ) { ?>
<?php wp_nav_menu( array(
'container' => '',
'menu_class' => 'sub-header-menu',
'theme_location' => 'sub-header-menu'
)
);
?>
<?php } ?>
<?php responsive_header_bottom(); // after header content hook ?>
</div><!-- end of #header -->
<?php responsive_header_end(); // after header container hook ?>
<?php responsive_wrapper(); // before wrapper container hook ?>
<div id="wrapper" class="clearfix">
<?php responsive_wrapper_top(); // before wrapper content hook ?>
<?php responsive_in_wrapper(); // wrapper hook ?>运行wp3.9.1,在一个名为http://www.maedchenhaus.org的真实测试版页面上运行以下内容
主题2014,儿童主题(二十四岁-儿童)十四色-插件
和元滑块插件((易于使用幻灯片插件)。创建SEO优化响应幻灯片与Nivo滑翔机,Flex滑翔机,硬币滑翔机和响应幻灯片。2.8.1版,由Matcha实验室提供,请访问插件站点)
好的,我想把插件放在标题的中心--类似于下面的站点http://www.amadeu-antonio-stiftung.de/
这个是可能的吗?
注意:就像现在一样-看起来很有趣。
我已经把这个插件放到了第一个帖子里--看吧
此外,我还尝试在编辑header.php时将这些短代码放入头中。
但这看起来没什么大不了的。
好的问题:我要在哪里编辑header.php --把元滑块的短代码放在哪里?
我很想听听你的意见
让我知道-在哪里添加的短代码,以使滑块进入头-中心。
更新猜测,我必须输入以下代码
<?php
echo do_shortcode("[metaslider id=36]");
?>更新的
<!DOCTYPE html>
<html lang="en-US">
<head>
<body class="home blog logged-in admin-bar custom-background masthead-fixed list-view full-width grid customize-support">
<div id="page" class="hfeed site">
<header id="masthead" class="site-header" role="banner">
<div id="main" class="site-main">
<div id="main-content" class="main-content">
<div id="primary" class="content-area">
<div id="content" class="site-content" role="main">
<article id="post-7" class="post-7 post type-post status-publish format-standard hentry category-uncategorized">看看header.php --在我编辑的地方--这简直是一文不值。这是没有意义的-完全没有意义。
<?php
/**
* The Header for our theme
*
* Displays all of the <head> section and everything up till <div id="main">
*
* @package WordPress
* @subpackage Twenty_Fourteen
* @since Twenty Fourteen 1.0
*/
?><!DOCTYPE html>
<!--[if IE 7]>
<html class="ie ie7" <?php language_attributes(); ?>>
<![endif]-->
<!--[if IE 8]>
<html class="ie ie8" <?php language_attributes(); ?>>
<![endif]-->
<!--[if !(IE 7) | !(IE 8) ]><!-->
<html <?php language_attributes(); ?>>
<!--<![endif]-->
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width">
<title><?php wp_title( '|', true, 'right' ); ?></title>
<link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
<!--[if lt IE 9]>
<script src="<?php echo get_template_directory_uri(); ?>/js/html5.js"></script>
<![endif]-->
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<div id="page" class="hfeed site">
<?php if ( get_header_image() ) : ?>
<div id="site-header">
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home">
<img src="<?php header_image(); ?>" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="">
</a>
</div>
<?php endif; ?>
<header id="masthead" class="site-header" role="banner">
<div class="header-main">
<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
<div class="search-toggle">
<a href="#search-container" class="screen-reader-text"><?php _e( 'Search', 'twentyfourteen' ); ?></a>
</div>
[metaslider id=36]
<nav id="primary-navigation" class="site-navigation primary-navigation" role="navigation">
<button class="menu-toggle"><?php _e( 'Primary Menu', 'twentyfourteen' ); ?></button>
<a class="screen-reader-text skip-link" href="#content"><?php _e( 'Skip to content', 'twentyfourteen' ); ?></a>
<?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu' ) ); ?>
</nav>
</div>
<div id="search-container" class="search-box-wrapper hide">
<div class="search-box">
<?php get_search_form(); ?>
</div>
</div>
</header><!-- #masthead -->发布于 2014-06-20 23:08:24
您需要将正确的代码放入header.php中,目前您正在放置metaslider id=36,这是不正确的,您需要用以下内容替换它:
<?php
echo do_shortcode("[metaslider id=36]"); ?>当然,假设您激活了插件,创建了一个ID = 36的滑块。我希望这能帮上忙
https://wordpress.stackexchange.com/questions/150269
复制相似问题