wordpress - 为二十十二主题添加丝带包装

标签 wordpress css

我想在我的页面左侧添加一个功能区。我正在使用 word press 这个伟大的平台。具体来说,二十二模板。我进入代码并在 themes/twentytwelve/style.css & themes/twentytwelve/header.php 下进行编辑。问题是它仅以纯文本形式显示在右侧。 Css 没有做任何事情。这是我试图在 wp 主题中完成的:http://jsfiddle.net/H6rQ6/9448/

ribbon- themes/twentytwelve/style.css 的 CSS

/*Ribbon Wrapper*/
.ribbon-wrapper-green {
  width: 85px;
  height: 88px;
  overflow: hidden;
  position: absolute;
  top: -3px;
  right: -3px;
}

.ribbon-green {
  font: bold 15px Sans-Serif;
  color: #333;
  text-align: center;
  text-shadow: rgba(255,255,255,0.5) 0px 1px 0px;
  -webkit-transform: rotate(45deg);
  -moz-transform:    rotate(45deg);
  -ms-transform:     rotate(45deg);
  -o-transform:      rotate(45deg);
  position: relative;
  padding: 7px 0;
  left: -5px;
  top: 15px;
  width: 120px;
  background-color: #BFDC7A;
  background-image: -webkit-gradient(linear, left top, left bottom, from(#BFDC7A), to(#8EBF45)); 
  background-image: -webkit-linear-gradient(top, #BFDC7A, #8EBF45); 
  background-image:    -moz-linear-gradient(top, #BFDC7A, #8EBF45); 
  background-image:     -ms-linear-gradient(top, #BFDC7A, #8EBF45); 
  background-image:      -o-linear-gradient(top, #BFDC7A, #8EBF45); 
  color: #6a6340;
  -webkit-box-shadow: 0px 0px 3px rgba(0,0,0,0.3);
  -moz-box-shadow:    0px 0px 3px rgba(0,0,0,0.3);
  box-shadow:         0px 0px 3px rgba(0,0,0,0.3);
}

.ribbon-green:before, .ribbon-green:after {
  content: "";
  border-top:   3px solid #6e8900;   
  border-left:  3px solid transparent;
  border-right: 3px solid transparent;
  position:absolute;
  bottom: -3px;
}

.ribbon-green:before {
  left: 0;
}
.ribbon-green:after {
  right: 0;
}

Header.php

<div id="page" class="hfeed site">
    <div class="ribbon-wrapper-green"><div class="ribbon-green">Welcome</div></div>
    <header id="masthead" class="site-header" role="banner">
        <hgroup>
            <img class="altlogo" src="http://www.theascp.org/wp-content/themes/ascpcics/images/ascpLogo.png" alt="" />

        </hgroup>

        <nav id="site-navigation" class="main-navigation" role="navigation">
            <h3 class="menu-toggle"><?php _e( 'Menu', 'twentytwelve' ); ?></h3>
            <a class="assistive-text" href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentytwelve' ); ?>"><?php _e( 'Skip to content', 'twentytwelve' ); ?></a>
            <?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu' ) ); ?>
            <h1 class="site-title"><?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?></h1>
            <h2 class="site-description"><?php bloginfo( 'description' ); ?></h2>
        </nav><!-- #site-navigation -->

        <?php $header_image = get_header_image();
        if ( ! empty( $header_image ) ) : ?>
            <a href="<?php echo esc_url( home_url( '/' ) ); ?>"><img src="<?php echo esc_url( $header_image ); ?>" class="header-image" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="" /></a>
        <?php endif; ?>
    </header><!-- #masthead -->

    <div id="main" class="wrapper">

最佳答案

与fiddle相比,CSS中没有.wrapper规则;但是指向 Wordpress 版本的链接将有助于了解这里出了什么问题。

关于wordpress - 为二十十二主题添加丝带包装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18562756/

相关文章:

wordpress - HTTPS 无法正常工作 Wordpress

css - :not selector doesn't hit children

CSS Nav 背景图像未显示

javascript - 带有 chart.js 的 angularjs 中的响应式图表

wordpress - 使用 WordPress 的 Walker_Nav_Menu 在父 li 的 div 内添加子菜单

php - 抽象路径或 __FILE__?

wordpress - 如何使用 Yoast SEO 插件在标题和描述中添加 WooCommerce 产品的字段 'regular price' 和 'sku'?

html - 如何将 navbar-brand 与其余链接对齐

html - Bootstrap 响应表和按钮

css - 如何使用图标列表元素或模块将图标对齐到文本的右侧?