Add crowdriff to blog single and archive pages
authorLaury GvR <laury@gaslightmedia.com>
Fri, 14 Dec 2018 21:47:37 +0000 (16:47 -0500)
committerLaury GvR <laury@gaslightmedia.com>
Fri, 14 Dec 2018 21:47:37 +0000 (16:47 -0500)
sections/blog-archive.php
sections/blog-single.php

index 29dfd72..ff8560b 100644 (file)
@@ -1,3 +1,13 @@
+<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-archive">
     <div class="row">
         <?php get_template_part('parts/blog-content-area'); ?>
index d0075b7..096890e 100644 (file)
@@ -1,26 +1,36 @@
-                    <main class="blog-single">
-                        <div class="row">
-                            <div id="blog-posts-over" class="small-12 medium-9 columns">
-                                <?php if(have_posts()) : while(have_posts()): the_post();?>
-                                <div class="row blog-post-container">
-                                    <div class="small-11 small-centered columns">
-                                        <div class="row">
-                                            <div class="small-12 columns">
-                                                <?php get_template_part('parts/blog-text-single'); ?>
-                                                <?php if ( comments_open() || get_comments_number() ) :
-                                                comments_template();
-                                                endif; ?>
-                                            </div>
-                                        </div>
-                                    </div>
-                                </div>
-                                <?php endwhile; ?>
-                                <?php else: ?>
-                                <div id="post-404" class="noposts">
-                                    <p><?php _e('Sorry, no results were found.');?></p>
-                                </div><!-- /#post-404 -->
-                                <?php endif;?>
-                            </div>
-                            <?php get_template_part('parts/blog-sidebar-r'); ?>
+<div id="header-crowdriff">
+    <?php 
+        if (function_exists('the_field')) {
+            $myCats = get_the_category();
+            if ($myCats && $myCats[0]) {;
+                echo the_field('post_crowdriff',$myCats[0]);
+            }
+        }
+    ?>
+</div>
+<main class="blog-single">
+    <div class="row">
+        <div id="blog-posts-over" class="small-12 medium-9 columns">
+            <?php if(have_posts()) : while(have_posts()): the_post();?>
+            <div class="row blog-post-container">
+                <div class="small-11 small-centered columns">
+                    <div class="row">
+                        <div class="small-12 columns">
+                            <?php get_template_part('parts/blog-text-single'); ?>
+                            <?php if ( comments_open() || get_comments_number() ) :
+                            comments_template();
+                            endif; ?>
                         </div>
-                    </main>
\ No newline at end of file
+                    </div>
+                </div>
+            </div>
+            <?php endwhile; ?>
+            <?php else: ?>
+            <div id="post-404" class="noposts">
+                <p><?php _e('Sorry, no results were found.');?></p>
+            </div><!-- /#post-404 -->
+            <?php endif;?>
+        </div>
+        <?php get_template_part('parts/blog-sidebar-r'); ?>
+    </div>
+</main>
\ No newline at end of file