Blog: Show frontpage crowdriff on home/archive, category crowdriff on category
authorLaury GvR <laury@gaslightmedia.com>
Wed, 27 Mar 2019 19:25:12 +0000 (15:25 -0400)
committerLaury GvR <laury@gaslightmedia.com>
Wed, 27 Mar 2019 19:25:12 +0000 (15:25 -0400)
index.php
sections/blog-archive.php
sections/blog-category.php [new file with mode: 0644]
sections/blog-home.php
sections/front-page.php

index 94dddb9..8cbeba1 100644 (file)
--- a/index.php
+++ b/index.php
                     } 
                     if (is_home()) { 
                         include "sections/blog-home.php";
+                    }
+                    if (is_category() ) {
+                        include "sections/blog-category.php";
                     } 
                     if (is_archive()) { 
                         include "sections/blog-archive.php";
-                    } 
+                    }
                     if (is_single()) {
                         include "sections/blog-single.php";
                     }
index ff8560b..5a43fd5 100644 (file)
@@ -1,16 +1,11 @@
-<div id="header-crowdriff">
-    <?php 
-        if (function_exists('the_field')) {
-            $term = get_queried_object();
-            if ($term) {
-                echo get_field('post_crowdriff', get_queried_object());
-            }
-        }
-    ?>
-</div>
+<?php if ( function_exists('the_field') && get_field('frontpage_crowdriff', get_option( 'page_on_front' ) ) ) { ?>
+    <div id="header-crowdriff">
+        <?php the_field('frontpage_crowdriff', get_option( 'page_on_front' ) ); ?>
+    </div>
+<?php } ?>
 <main class="blog-archive">
     <div class="row">
         <?php get_template_part('parts/blog-content-area'); ?>
         <?php get_template_part('parts/blog-sidebar-r'); ?>
     </div>
-</main>
\ No newline at end of file
+</main>
diff --git a/sections/blog-category.php b/sections/blog-category.php
new file mode 100644 (file)
index 0000000..28482c8
--- /dev/null
@@ -0,0 +1,17 @@
+
+<div id="header-crowdriff">
+    <?php 
+        if (function_exists('the_field')) {
+            $term = get_queried_object();
+            if ($term) {
+                echo get_field('post_crowdriff', get_queried_object());
+            }
+        }
+    ?>
+</div>
+<main class="blog-category">
+    <div class="row">
+        <?php get_template_part('parts/blog-content-area'); ?>
+        <?php get_template_part('parts/blog-sidebar-r'); ?>
+    </div>
+</main>
index 93bbe60..e3059ee 100644 (file)
@@ -1,15 +1,11 @@
-                    <main class="blog-home">
-                        <?php if (function_exists('the_field') && get_field('interior_header_crowdriff_script',get_option( 'page-for-posts' ))) { ?>
-                            <div id="header-crowdriff">
-                                <?php echo the_field('interior_header_crowdriff_script',get_option( 'page-for-posts' )); ?>
-                            </div>
-                        <?php } else { ?>
-                            <!-- <div id="header-featured"> -->
-                                <?php //echo glm_get_header(); ?>
-                            <!-- </div> -->
-                        <?php } ?>
-                        <div class="row">
-                            <?php get_template_part('parts/blog-content-area'); ?>
-                            <?php get_template_part('parts/blog-sidebar-r'); ?>
-                        </div>
-                    </main>
\ No newline at end of file
+<main class="blog-home">
+    <?php if ( function_exists('the_field') && get_field('frontpage_crowdriff', get_option( 'page_on_front' ) ) ) { ?>
+        <div id="header-crowdriff">
+            <?php the_field('frontpage_crowdriff', get_option( 'page_on_front' ) ); ?>
+        </div>
+    <?php } ?>
+    <div class="row">
+        <?php get_template_part('parts/blog-content-area'); ?>
+        <?php get_template_part('parts/blog-sidebar-r'); ?>
+    </div>
+</main>
\ No newline at end of file
index d34d97c..e9adfcf 100644 (file)
@@ -27,7 +27,7 @@
                 <?php the_field('frontpage_crowdriff'); ?>
             </div>
         <?php } else { ?>
-            no crowdriff
+            
         <?php } ?>
         <!-- <?php //get_template_part('parts/blog-feed-front'); ?>
         <div id="lens">