页面内容不会在wordpress上显示

时间:2018-01-23 11:11:16

标签: php jquery css wordpress themes

我正在使用WordPress创建网站我已经为他们添加了一个php页面并尝试使用它但问题是,当我打开页面作为独立页面时它工作正常但是当我尝试使用 wordpress 它没有显示任何内容。有什么问题以及如何解决?

我的问题是如何在保留所有CSS和样式的情况下为网站创建新页面。

我将不胜感激。

引用此网址How to Create a Custom Page in WordPress

  1. 复制文件page.php
  2. 添加此行
  3. 添加自定义php页面
  4. 在wordpress中在模板中选择创建模板
  5. 如果代码写在WordPress编辑器的下方,这就是网页的外观: enter image description here

    enter image description here

    如果代码是在WordPress编辑器中编写的话,这就是网页的外观

    enter image description here enter image description here

    如果代码是独立编写的话,这就是网页的外观

    enter image description here

    的代码:

    <!DOCTYPE html>
    <html>
    
    <head>
      <title>Form Validation</title>
      <!-- Latest compiled and minified BootStarp CSS -->
      <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
      <!-- jQuery library -->
      <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
    
      <script type="text/javascript">
        $(function() {
          $("#textarea").hide()
          $("#droplistID").change(function() {
            $(this).val() == 'select' ? $("#textarea").hide() : $("#textarea").show();
          });
        });
      </script>
    
    </head>
    
    <body>
      <div id="page-wrapper">
        <div class="container">
          <h1>
            Send Post Data to AJAX
          </h1>
          <form name="myForm" class="form-horizontal" id="myform" action="#" onsubmit="return submitForm();" method="POST" enctype="multipart/form-datam">
            <div class="panel panel-info">
              <div class="panel-heading">Form</div>
              <div class="panel-body">
                <div class="row">
                  <div class="col-md-6">
                    <div class="form-group">
                      <label for="name" class="col-md-4">Date *</label>
                      <div class="col-md-6">
                        <input type="text" class="form-control" id="name" name="name" placeholder="Enter Name" required/>
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="Title" class="col-md-4">Title *</label>
                      <div class="col-md-6">
                        <input type="text" class="form-control" id="mobile" name="phone" placeholder="Enter the Title" required/>
                      </div>
                    </div>
                    <div class="form-group  ">
                      <label for="category" class="col-md-4">select Category *</label>
                      <div class="col-md-6">
                        <select name="droplist" id="droplistID">
                               <option id = "option1" value="select" selected>Select</option>
                               <option id = "option2" value="category 1">category 34</option>
                               <option id = "option3" value="category 2">category 2</option>
                               <option id = "option4" value="category 3">category 3</option>
                           </select>
                      </div>
                    </div>
    
                    <div id="textarea">
                      <div class="form-group  ">
                        <label for="text" class="col-md-4">Enter a text </label>
                        <div class="col-md-6">
                          <textarea cols="60" rows="30"> </textarea>
                        </div>
                      </div>
                    </div>
    
                    <div class="form-group  ">
                      <label for="image" class="col-md-4">Select Image </label>
                      <div class="col-md-6">
                        <input type="file" class="form-control" name="image">
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
            <div class="col-md-4 col-md-offset-4" style="margin-bottom: 50px;">
              <center>
                <input type="submit" class="btn btn-primary" value="Submit" />
              </center>
            </div>
          </form>
        </div>
      </div>
    </body>
    
    </html>
    

0 个答案:

没有答案