WordPress-我的主题和JQuery中缺少管理栏,页脚和补充工具栏不起作用

时间:2019-07-11 16:06:01

标签: javascript php jquery html wordpress

当时我正在为我的wordpress博客创建主题,但是当我上传主题以托管博客时,我丢失了/没有出现页脚,侧边栏和管理栏,但是当我在本地主机上创建页脚时,侧边栏和管理栏出现/出现并且我的jQuery无法正常工作

我的网站: https://j-isfun.com

index.php

<?php get_header(); ?>
<section>
  <div class="container">
    <div class="row wow fadeIn">

      <?php
      if ( have_posts() ) :
        $counter = 1;
      while ( have_posts() ) :
        the_post();
      ?>

        <div class="col-lg-4 col-md-6 col-sm-12 mb-lg-4 mb-4">
          <div class="card">
            <div class="view overlay zoom">
              <a href="<?= get_permalink(); ?>">
                <?php if( has_post_thumbnail() ) { the_post_thumbnail( 'post_thumbnail', ['class' => 'img-fluid rounded-0'] ); } else { echo '<img src="' . get_bloginfo( 'stylesheet_directory' ) 
                  . '/img/no-thumbnail.jpg" class="img-fluid rounded-0" />';; };
                ?>
                <h1 class="judulq"><?php echo mb_strimwidth(get_the_title(), 0, 28, '...'); ?></h1>
                <span class="boxdurat">
                  <i class="fa fa-clock position-absolute jam"></i>
                  <p class="jamka"><?php the_field('duration'); ?></p>
                </span>
              </a>
            </div>
          </div>
        </div>


      <?php
      if ( $counter % 12 == 0 ) :
      ?>

      </div>
      <div class="row wow fadeIn">

      <?php
      endif;
      $counter++;
      endwhile;
      endif;
      ?>

      </div>

    <?php javxid_pagination(); ?>

  </div>
</section>

<?php get_footer(); ?>

footer.php

<script type="text/javascript">
        $('#myCollapsible').collapse({
        toggle: false
        })
        $('#myCollapsible').collapse({
        dispose: true
        })
    </script>
    <footer class="page-footer font-small bg-footer-pinky">
      <div class="footer-copyright text-center py-3">© 2019 Copyright:
        <a href="http://google.com" class="white-text font-weig">J-IsFun</a>
      </div>
    </footer>
  <?php wp_footer(); ?>
  </body>
</html>

navbar.inc.php

<nav class="navbar navbar-expand-lg navbar-dark bg-pinky lighten-1 mb-4" id="comehere">
  <a class="navbar-brand" href="<?= home_url() ?>"><?php echo '<img src="' . get_template_directory_uri() . '/img/logo.png"/ width="150px" height="35px">' ?></a>
    <button class="navbar-toggler second-button" type="button" data-toggle="collapse" data-target="#navbarSupportedContent23"
      aria-controls="navbarSupportedContent23" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon2"><span></span><span></span><span></span><span></span></div>
    </button>
    <div class="collapse navbar-collapse" id="navbarSupportedContent23">
    <?php wp_nav_menu([
      'menu'            => 'primary',
      'theme_location'  => 'primary',
      'container'       => '',
      'container_class' => '',
      'container_id'    => 'navbarSupportedContent23',
      'menu_class'      => 'navbar-nav mr-auto',
      'fallback_cb'     => 'bs4navwalker::fallback',
      'walker'          =>  new bs4navwalker()
    ]);
    ?>
    <?php get_search_form(); ?>
    </div>
</nav>

function.php

/**
  INCLUDE CSS&JS FILE
*/
function theme_enqueue_scripts() {
        wp_enqueue_style( 'Font_Awesome', 'https://use.fontawesome.com/releases/v5.6.1/css/all.css' );
        wp_enqueue_style( 'Bootstrap_css', get_template_directory_uri() . '/css/bootstrap.min.css' );
        wp_enqueue_style( 'MDB', get_template_directory_uri() . '/css/mdb.min.css' );
        wp_enqueue_style( 'Style', get_template_directory_uri() . '/style.css' );
        wp_enqueue_script( 'jQuery', get_template_directory_uri() . '/js/jquery-3.4.1.min.js', array(), '3.4.1', true );
        wp_enqueue_script( 'Tether', get_template_directory_uri() . '/js/popper.min.js', array(), '1.0.0', true );
        wp_enqueue_script( 'Bootstrap', get_template_directory_uri() . '/js/bootstrap.min.js', array(), '1.0.0', true );
        wp_enqueue_script( 'MDB', get_template_directory_uri() . '/js/mdb.min.js', array(), '1.0.0', true );
        wp_enqueue_script( 'Hamburger', get_template_directory_uri() . '/js/hmb.js', array(), '1.0.0', true );
        }
add_action( 'wp_enqueue_scripts', 'theme_enqueue_scripts' );
/**
  END
*/

sidebar.php

<div id="sidebar" class="col-lg-3">
    <div class="card rounded-0 border sticky-top">
        <div class="card-body">
        </div>
    </div>
    <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>
    <?php endif; ?>
</div> 

0 个答案:

没有答案