LearnPress создает шаблон для содержания курса - другой поток - PullRequest
0 голосов
/ 04 октября 2018

Можно ли создать поток курса следующим образом:

$(document).ready(function() {
    $("div.bhoechie-tab-menu>div.list-group>a").click(function(e) {
        e.preventDefault();
        $(this).siblings('a.active').removeClass("active");
        $(this).addClass("active");
        var index = $(this).index();
        $("div.bhoechie-tab>div.bhoechie-tab-content").removeClass("active");
        $("div.bhoechie-tab>div.bhoechie-tab-content").eq(index).addClass("active");
    });
});
/*  bhoechie tab */
div.bhoechie-tab-container{
  z-index: 10;
  background-color: #ffffff;
  padding: 0 !important;
  border-radius: 4px;
  -moz-border-radius: 4px;
  border:1px solid #ddd;
  margin-top: 20px;
  margin-left: 50px;
  -webkit-box-shadow: 0 6px 12px rgba(0,0,0,.175);
  box-shadow: 0 6px 12px rgba(0,0,0,.175);
  -moz-box-shadow: 0 6px 12px rgba(0,0,0,.175);
  background-clip: padding-box;
  opacity: 0.97;
  filter: alpha(opacity=97);
}
div.bhoechie-tab-menu{
  padding-right: 0;
  padding-left: 0;
  padding-bottom: 0;
}
div.bhoechie-tab-menu div.list-group{
  margin-bottom: 0;
}
div.bhoechie-tab-menu div.list-group>a{
  margin-bottom: 0;
}
div.bhoechie-tab-menu div.list-group>a .glyphicon,
div.bhoechie-tab-menu div.list-group>a .fa {
  color: #5A55A3;
}
div.bhoechie-tab-menu div.list-group>a:first-child{
  border-top-right-radius: 0;
  -moz-border-top-right-radius: 0;
}
div.bhoechie-tab-menu div.list-group>a:last-child{
  border-bottom-right-radius: 0;
  -moz-border-bottom-right-radius: 0;
}
div.bhoechie-tab-menu div.list-group>a.active,
div.bhoechie-tab-menu div.list-group>a.active .glyphicon,
div.bhoechie-tab-menu div.list-group>a.active .fa{
  background-color: #5A55A3;
  background-image: #5A55A3;
  color: #ffffff;
}
div.bhoechie-tab-menu div.list-group>a.active:after{
  content: '';
  position: absolute;
  left: 100%;
  top: 50%;
  margin-top: -13px;
  border-left: 0;
  border-bottom: 13px solid transparent;
  border-top: 13px solid transparent;
  border-left: 10px solid #5A55A3;
}

div.bhoechie-tab-content{
  background-color: #ffffff;
  /* border: 1px solid #eeeeee; */
  padding-left: 20px;
  padding-top: 10px;
}

div.bhoechie-tab div.bhoechie-tab-content:not(.active){
  display: none;
}
<link href="//netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!------ Include the above in your HEAD tag ---------->

<div class="container">
	<div class="row">
        <div class="col-lg-5 col-md-5 col-sm-8 col-xs-9 bhoechie-tab-container">
            <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 bhoechie-tab-menu">
              <div class="list-group">
                <a href="#" class="list-group-item active text-center">
                  <h4 class="glyphicon glyphicon-plane"></h4><br/>Lesson 1
                </a>
                <a href="#" class="list-group-item text-center">
                  <h4 class="glyphicon glyphicon-road"></h4><br/>Lesson 2
                </a>
                <a href="#" class="list-group-item text-center">
                  <h4 class="glyphicon glyphicon-home"></h4><br/>Lesson 3
                </a>
                <a href="#" class="list-group-item text-center">
                  <h4 class="glyphicon glyphicon-cutlery"></h4><br/>Lesson 4
                </a>
                <a href="#" class="list-group-item text-center">
                  <h4 class="glyphicon glyphicon-credit-card"></h4><br/>Lesson 5
                </a>
              </div>
            </div>
            <div class="col-lg-9 col-md-9 col-sm-9 col-xs-9 bhoechie-tab">
                <!-- flight section -->
                <div class="bhoechie-tab-content active">
                    <center>
                      <h2 style="font-size:2em;color:#55518a">Lesson 1 Heading</h2
                      <p style="margin-top: 0;color:#55518a">Lesson 1 Content</p>
                      <button style="margin-top: 0;color:#55518a">Complete Lesson</button>
                      </button>
                    </center>
                </div>
                <!-- train section -->
                <div class="bhoechie-tab-content">
                    <center>
                      <h2 style="font-size:2em;color:#55518a">Lesson 2 Heading</h2
                      <p style="margin-top: 0;color:#55518a">Lesson 2 Content</p>
                      <button style="margin-top: 0;color:#55518a">Complete Lesson</button>
                      </button>
                    </center>
                </div>
    
                <!-- hotel search -->
                <div class="bhoechie-tab-content">
                    <center>
                      <h2 style="font-size:2em;color:#55518a">Lesson 3 Heading</h2
                      <p style="margin-top: 0;color:#55518a">Lesson 3 Content</p>
                      <button style="margin-top: 0;color:#55518a">Complete Lesson</button>
                      </button>
                    </center>
                </div>
                <div class="bhoechie-tab-content">
                    <center>
                      <h2 style="font-size:2em;color:#55518a">Lesson 4 Heading</h2
                      <p style="margin-top: 0;color:#55518a">Lesson 4 Content</p>
                      <button style="margin-top: 0;color:#55518a">Complete Lesson</button>
                      </button>
                    </center>
                </div>
                <div class="bhoechie-tab-content">
                    <center>
                      <h2 style="font-size:2em;color:#55518a">Lesson 5 Heading</h2
                      <p style="margin-top: 0;color:#55518a">Lesson 5 Content</p>
                      <button style="margin-top: 0;color:#55518a">Complete Lesson</button>
                      </button>
                    </center>
                </div>
            </div>
        </div>
  </div>
</div>

Если это возможно, не могли бы вы помочь мне со ссылками на то, как получить все данные курсов (предварительный просмотр курса, уроки и весь их контент)?Я могу сделать это, используя get_posts, но я не уверен, что это хороший способ сделать это, так как LearnPress имеет множество функций проверки безопасности, хода курса и т. Д.

Например, я пытаюсь поставитьэто в моем обычае content-learning.php в моей детской теме:

<code>$user          = LP_Global::user();
$course_item   = LP_Global::course_item();
$course        = LP_Global::course();
$can_view_item = $user->can_view_item( $course_item->get_id(), $course->get_id() );

echo '<pre>';var_dump( $course_item );echo '
';

var_dump( $course_items ); возвращает значение NULL, но когда я переключаюсь на стандартную тему, она работает, какая ей «зависимость» нужна?почему не работает?

Спасибо.

...