adding dynamic page content to the video lessons page
authorAnthony Talarico <talarico@gaslightmedia.com>
Thu, 26 Jul 2018 15:53:15 +0000 (11:53 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Thu, 26 Jul 2018 15:53:15 +0000 (11:53 -0400)
content-single.php
functions.php
single.php

index 15f6c44..cf2abf4 100644 (file)
@@ -7,6 +7,8 @@ $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" : "";
+$lessons_page = get_post(369);
+$lesson_content = $lessons_page->post_content;
 ?>
 <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
        <header class="entry-header">
@@ -28,6 +30,9 @@ $post_date_class = ((!empty($post_date) && $post_date == ' ') || has_post_thumbn
        </header><!-- .entry-header -->
 
        <div class="entry-content">
+        <?php if( $pt === 'cmvl_channel'){ ?>
+            <p> <?php echo $lesson_content; ?> </p>
+        <?php } ?>
                <?php the_content(); ?>
                <?php
                        wp_link_pages( array(
index ae30a6b..cac1ad3 100644 (file)
@@ -282,4 +282,10 @@ function add_logout($items, $args) {
     }
   return $items;
 }
-add_filter('wp_nav_menu_items', 'add_logout', 10, 2);
\ No newline at end of file
+add_filter('wp_nav_menu_items', 'add_logout', 10, 2);
+
+function displaydate(){
+    return date('l, F t, Y');
+}
+add_shortcode( 'date', 'displaydate' );
+add_filter( 'show_admin_bar', '__return_false' );
\ No newline at end of file
index a867188..09271f9 100644 (file)
@@ -13,10 +13,14 @@ if($pt === 'cmvl_channel'){
 }
 get_header(); ?>
 <div class="mid-content clearfix">
-       <div id="primary" class="content-area <?php echo $fw; ?>">
-    <a href="<?php echo get_permalink(363); ?>">Back to my courses</a>
+    <div id="primary" class="content-area <?php echo $fw; ?>">
+    <?php if($pt === 'cmvl_channel'){ ?>
+        <a href="<?php echo get_permalink(363); ?>">Back to my courses</a>
+        
+    <?php } ?>
+   
                <main id="main" class="site-main" role="main">
-
+        
                <?php while ( have_posts() ) : the_post(); ?>
 
                        <?php get_template_part( 'content', 'single' );