Php-tware:如何让Meta-Slider进入标题中心?

时间:2014-06-20 作者:zero

更新-标题。有问题的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( \'&#124;\', 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 ?>
在一个名为http://www.maedchenhaus.org

主题2014,儿童主题(Twenty14 child)十四色插件

和元滑块插件(易于使用的幻灯片插件。使用Nivo滑块、Flex滑块、Coin滑块和响应幻灯片创建SEO优化的响应幻灯片。版本2.8.1 |由Matca Labs提供|访问插件站点))

我想把插件放在标题的中心,类似于下面的站点http://www.amadeu-antonio-stiftung.de/

这可能吗?

注意:就像现在一样,它看起来很有趣。

我已经把插件放到了第一个帖子中-看到了吗

除此之外,我还尝试在编辑标题时将短代码放入标题中。php。

但这看起来很糟糕。

好的,问题:我必须在哪里编辑标题。php-元滑块的短代码放在哪里?

很高兴听到您的消息,请参阅我在使用firebug时发现的代码-

让我知道在哪里添加快捷码,以将滑块移到标题中心。

update 我想我必须输入这个代码

<?php 
    echo do_shortcode("[metaslider id=36]"); 
?>

end of update

<!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">
请参见页眉。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 -->

1 个回复
最合适的回答,由SO网友:Douchi 整理而成

您需要在标题中输入正确的代码。php,当前您正在放置[metaslider id=36],这是不正确的,您需要将其替换为:

<?php 
echo do_shortcode("[metaslider id=36]"); ?>
当然,假设您激活了插件,并创建了一个ID为36的滑块。我希望这会有所帮助

结束