添加CSS标签到WordPress无法正常工作?

时间:2014-04-15 15:48:28

标签: html css wordpress

我试图在我的一个wordpress页面上添加一系列CSS标签,但它似乎无法正常工作(例如,当我将以下代码粘贴到wordpress页面时,它会剥离一些主要组件的标签)。这里是完成标签应该是什么样子的链接:

http://www.stylerepublicmagazine.com/csstabs.html

这是我尝试粘贴到WordPress的代码,是的,所有必要的CSS文件都会上传到我的主题。知道为什么Wordpress不能正确显示它吗?

<div class="tabbed-view">
  <!--tabbed 01 Starts here-->
  <form>
    <div class="tab-container grey left rounded">
      <label class="tab-label">
       <input class="tab-radio" type="radio" name="page" value="page5" checked="checked"/>
       <h2 class="tab">Interiors</h2>
       <article class="tab-page" id="page5">
       <h3>Description</h3>
       <h4>Subtitle</h4><p>Your content here</p><p> Aenean tortor mi, imperdiet id, gravida eu, posuere eu, felis. Mauris sollicitudin, turpis in hendrerit sodales, lectus ipsum pellentesque ligula, sit amet scelerisque urna nibh ut arcu. Aliquam in lacus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nulla placerat aliquam wisi.</p><p> Mauris viverra odio. Quisque fermentum pulvinar odio. Proin posuere est vitae ligula. Etiam euismod. Cras a eros.</p>
        </article>
        </label>
        <label class="tab-label">
        <input class="tab-radio" type="radio" name="page" value="page6" />
        <h2 class="tab">Bathrooms</h2>
        <article class="tab-page" id="page6">
         <h3>Stylish Bathrooms</h3>
         <h4>Subtitle</h4><p>Your content here</p>
        </article>
        </label>
        <label class="tab-label">
        <input class="tab-radio" type="radio" name="page" value="page7" />
        <h2 class="tab">Kitchen</h2>
        <article class="tab-page" id="page7">
         <h3>Modern Kitchen</h3>
         <h4>Subtitle</h4><p>Your content here</p>
        </article>
        </label>
        <label class="tab-label">
        <input class="tab-radio" type="radio" name="page" value="page8" />
        <h2 class="tab">Extra Details</h2>
        <article class="tab-page" id="page8">
         <h3>Extra Details</h3>
         <h4>Subtitle</h4><p>Your content here</p>
        </article>
        </label>
    </div>
  </form>
 </div>
 <br clear="all" /></div>

1 个答案:

答案 0 :(得分:0)

你说&#34;所有必要的CSS文件都上传到我的主题&#34;,它们是否已链接?

如果没有,请在wordpress主题的header.php文件中添加以下行:

<?php if(is_page([YOUR PAGE ID])) { ?>
<link href="<?php bloginfo('template_url'); ?>/[CSS FIlE Name].css" type="text/css" rel="stylesheet" />

<script src="<?php bloginfo('template_url'); ?>/[JAVASCRIPT FIlE Name].js" type="text/javascript"></script>
<?php } ?>

用正确的值替换Page Id,CSS和Javascript。