adding styles and check for post type to change layout for videos
authorAnthony Talarico <talarico@gaslightmedia.com>
Thu, 12 Apr 2018 20:35:33 +0000 (16:35 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Thu, 12 Apr 2018 20:35:33 +0000 (16:35 -0400)
video lessons pages needed a check for post type to alter the layout

content-single.php
single.php
style.css

index 3122aec..bf3e943 100644 (file)
@@ -2,7 +2,8 @@
 /**
  * @package accesspress_parallax
  */
-
+global $post;
+$pt = $post->post_type;
 $post_date = of_get_option('post_date');
 $post_footer = of_get_option('post_footer');
 $post_date_class = ((!empty($post_date) && $post_date == ' ') || has_post_thumbnail()) ? " no-date" : "";
@@ -18,9 +19,11 @@ $post_date_class = ((!empty($post_date) && $post_date == ' ') || has_post_thumbn
                
                <h1 class="entry-title<?php echo esc_attr($post_date_class); ?>"><?php the_title(); ?></h1>
 
-               <div class="entry-meta">
-                       <?php accesspress_parallax_posted_on(); ?>
-               </div><!-- .entry-meta -->
+        <?php if( $pt !== 'cmvl_channel'){ ?>
+            <div class="entry-meta">
+                <?php accesspress_parallax_posted_on(); ?>
+            </div><!-- .entry-meta -->
+        <?php } ?>
        </header><!-- .entry-header -->
 
        <div class="entry-content">
index 8f8756b..ac9fc43 100644 (file)
@@ -4,39 +4,47 @@
  *
  * @package accesspress_parallax
  */
-
+global $post;
+$pt = $post->post_type;
+if($pt === 'cmvl_channel'){
+    $fw = 'full-width';
+}else {
+    $fw = false;
+}
 get_header(); ?>
 <div class="mid-content clearfix">
-       <div id="primary" class="content-area">
+       <div id="primary" class="content-area <?php echo $fw; ?>">
                <main id="main" class="site-main" role="main">
 
                <?php while ( have_posts() ) : the_post(); ?>
 
-                       <?php get_template_part( 'content', 'single' ); ?>
-
-                       <?php 
-                       $post_pagination = of_get_option('post_pagination');
-                       if( $post_pagination == 1 || !isset($post_pagination)) :
-                       the_post_navigation( array(
-                               'prev_text'                  => '<i class="fa fa-hand-o-left"></i>' . __( '%title', 'accesspress-parallax' ),
-               'next_text'                  => __( '%title', 'accesspress-parallax' ) . '<i class="fa fa-hand-o-right"></i>',
-               'in_same_term'               => true,
-                               ));
-                       endif;
-                       ?>
-
-                       <?php
-                               // If comments are open or we have at least one comment, load up the comment template
-                               if ( comments_open() || '0' != get_comments_number() ) :
-                                       comments_template();
-                               endif;
-                       ?>
-
-               <?php endwhile; // end of the loop. ?>
+                       <?php get_template_part( 'content', 'single' ); 
+
+            if($pt !== 'cmvl_channel'){
+                $post_pagination = of_get_option('post_pagination');
+                if( $post_pagination == 1 || !isset($post_pagination)) :
+                the_post_navigation( array(
+                    'prev_text'                  => '<i class="fa fa-hand-o-left"></i>' . __( '%title', 'accesspress-parallax' ),
+                    'next_text'                  => __( '%title', 'accesspress-parallax' ) . '<i class="fa fa-hand-o-right"></i>',
+                    'in_same_term'               => true,
+                    ));
+                endif;
+                
+                    // If comments are open or we have at least one comment, load up the comment template
+                    if ( comments_open() || '0' != get_comments_number() ) :
+                        comments_template();
+                    endif;
+            }
+               
+           endwhile; // end of the loop. ?>
 
                </main><!-- #main -->
        </div><!-- #primary -->
 
-<?php get_sidebar(); ?>
+<?php 
+    if($pt !== "cmvl_channel"){
+        get_sidebar(); 
+    }
+?>
 </div>
 <?php get_footer();
\ No newline at end of file
index 00d8108..2b63613 100644 (file)
--- a/style.css
+++ b/style.css
@@ -649,7 +649,9 @@ Content
     width: 69%;
     float: left;
 }
-
+#primary.full-width{
+    width: 100%;
+}
 #secondary {
     width: 28%;
     float: right;
@@ -758,7 +760,7 @@ Posts and pages
 }
 
 .entry-header h1.entry-title {
-    margin-left: 80px;
+    /* margin-left: 80px; */
 
 }
 
@@ -2496,3 +2498,46 @@ Responsive grid for pages
 .rtl .bx-wrapper .bx-controls-direction a {
     text-indent: 999999999px;
 }
+
+
+div.cmvl-courses-list-shortcode table thead tr th{
+    display: none;
+}
+div.cmvl-courses-list-shortcode table tbody tr{
+    width: 30%;
+    display:block;
+    height:auto;
+    margin: 10px;
+    padding: 10px;
+    overflow:auto;
+    float: left;
+    /* border: 1px solid lightgray; */
+    border-radius: 6px;
+    transition: box-shadow .2s ease-in-out, background-color .2s ease-in-out;
+    box-shadow: 5px 5px 25px 0 rgba(46,61,73,.2);
+}
+div.cmvl-courses-list-shortcode table tbody tr td{
+    text-align: center;
+}
+div.cmvl-courses-list-shortcode table tbody tr:hover{
+    cursor: pointer;
+    box-shadow: 2px 4px 8px 0 rgba(46,61,73,.2);
+    background-color: #F8F9FE;
+}
+@media (max-width: 640px){
+    div.cmvl-courses-list-shortcode table tbody tr{
+        width: 100%;    
+    }
+}
+div.cmvl-courses-list-shortcode table tbody tr td.narrow{
+    display: none;
+}
+.cmvl-stats-user-table tbody tr.cmvl-channel td a:not(.cmvl-details)::after{
+    content: " :: Lesson ";
+}
+.cmvl-stats-user-table tbody tr.cmvl-video td a:not(.cmvl-details)::after{
+    content: " :: Video ";
+}
+.cmvl-stats-user-table tbody tr.cmvl-video{
+    display: table-row;
+}
\ No newline at end of file