Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php get_header(); ?>
- <div id="wrapper">
- <div class="sidebar">
- <nav id="options">
- <ul id="sort-by" class="option-set clearfix">
- <li><a href="<?php bloginfo('url'); ?>" title="Home">Home</a></li>
- <li<?php
- if (in_category('3'))
- {
- echo " id=\"current\"";
- }
- ?>><a href="<?php bloginfo('url'); ?>/#sortBy=behindthescenes" title="<?php echo get_the_category_by_id(3); ?>" class="c"><?php echo get_the_category_by_id(3); ?></a></li>
- <li<?php
- if (in_category('1'))
- {
- echo " id=\"current\"";
- }
- ?>><a href="<?php bloginfo('url'); ?>/#sortBy=artistsprojects" title="<?php echo get_the_category_by_id(1); ?>" class="g"><?php echo get_the_category_by_id(1); ?></a></li>
- <li<?php
- if (in_category('5'))
- {
- echo " id=\"current\"";
- }
- ?>><a href="<?php bloginfo('url'); ?>/#sortBy=thebuildingproject" title="<?php echo get_the_category_by_id(5); ?>" class="l"><?php echo get_the_category_by_id(5); ?></a></li>
- <li<?php
- if (in_category('6'))
- {
- echo " id=\"current\"";
- }
- ?>><a href="<?php bloginfo('url'); ?>/#sortBy=newsbites" title="<?php echo get_the_category_by_id(6); ?>" class="p"><?php echo get_the_category_by_id(6); ?></a></li>
- <li<?php
- if (in_category('7'))
- {
- echo " id=\"current\"";
- }
- ?>><a href="<?php bloginfo('url'); ?>/#sortBy=offsite" title="<?php echo get_the_category_by_id(7); ?>" class="y"><?php echo get_the_category_by_id(7); ?></a></li>
- <li<?php
- if (in_category('8'))
- {
- echo " id=\"current\"";
- }
- ?>><a href="<?php bloginfo('url'); ?>/contact" title="<?php echo get_the_category_by_id(8); ?>" class="my"><?php echo get_the_category_by_id(8); ?></a></li>
- </ul>
- </nav>
- <div id="newsletter-wrap">
- <p>Subscribe to our email list</p>
- <?php echo do_shortcode( '[contact-form-7 id="147" title="Subscribe"]' ); ?>
- </div>
- <p class="classification"><a href="http://www.kettlesyard.co.uk/">Main site</a></p>
- <?php
- $pageintro=get_post_meta($post->ID,'Page_Intro',true);
- $pageintroref=get_post_meta($post->ID,'Page_Intro_Ref',true);
- if($pageintro != '') {
- echo '<footer><p>'. $pageintro . '</p><p>'. $pageintroref .'</p></p></footer>';
- } else {
- echo ' ';
- }
- ?>
- </div> <!--! /sidebar -->
- <div id="main" role="main">
- <?php foreach( get_the_category() as $cat ) echo '<section class="middle ' . $cat->slug . '" >'; ?>
- <?php if (have_posts()) : ?>
- <?php while (have_posts()) : the_post(); ?>
- <article>
- <figure>
- <?php
- $image_link=get_post_meta($post->ID,'Image_Link',true);
- if($image_link != '') {
- echo '<a href="http://example.com">'. get_the_post_thumbnail() .'</a>';
- } else {
- echo get_the_post_thumbnail();
- }
- ?>
- <figcaption>
- <?php
- // Call in the contents of a custom field called Credit and if custom field in admin panel is empty don't display <p> tags otherwise wrap contents of custom field in <p> tags
- $credit=get_post_meta($post->ID,'Credit',true);
- if($credit != '') {
- echo '<p>'. $credit .'</p>';
- } else {
- echo ' ';
- }
- ?>
- </figcaption>
- </figure>
- <?php if ( in_category('contact')) : //display nothing ?>
- <?php
- $sub_title=get_post_meta($post->ID,'subtitle',true);
- if($sub_title != '') {
- echo '<h1>'. get_the_title() .'<span> / '. $sub_title . '</span></h1>';
- } else {
- echo '<h1>'. get_the_title() .'<span> / ' . get_the_time('l jS F') .'</span></h1>';
- }
- ?>
- <?php else : ?>
- <?php
- $sub_title=get_post_meta($post->ID,'subtitle',true);
- if($sub_title != '') {
- echo '<h1>'. get_the_title() .'<span> / '. $sub_title . ' / ' . get_the_time('l jS F') .'</span></h1>';
- } else {
- echo '<h1>'. get_the_title() .'<span> / ' . get_the_time('l jS F') .'</span></h1>';
- }
- ?>
- <?php endif; ?>
- <?php the_content(''); ?>
- <?php if ( in_category( 'contact' ) ) : // Display nothing ?>
- <?php // Else, show comments
- else : ?>
- <div class="a-options">
- <a href="#post-<?php the_ID(); ?>" class="comments scrollto">Comment</a>
- <!-- share -->
- <div class="share-button">
- <div class="buttons">
- <div class="facebook">
- <div class="fb-like" data-send="false" data-layout="button_count" data-width="450" data-show-faces="false" data-font="arial"></div>
- </div>
- <div class="twitter">
- <a href="https://twitter.com/share" class="twitter-share-button" data-text="<?php the_title(); ?>" data-url="<?php the_permalink(); ?>" data-via="kettlesyard" data-related="kettlesyard" data-hashtags="kettlesyard">Tweet</a>
- <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
- </div>
- <div class="pinterest">
- <a href="http://pinterest.com/pin/create/button/?url=<?php the_permalink(); ?>" class="pin-it-button" count-layout="horizontal"><img border="0" src="//assets.pinterest.com/images/PinExt.png" title="Pin It" /></a>
- </div>
- </div>
- <span class="pseudo-button">+ Share</span>
- </div> <!--! /share -->
- </div><!--! /a-options -->
- <?php comments_template(); ?>
- <?php endif; ?>
- </article>
- <?php endwhile; ?>
- <?php endif; ?>
- <!-- Faulty Secondary loop referring to my question -->
- <div id="post-wrap">
- <?php // Show all posts within this category
- $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
- $args= array(
- 'category_name' => $cat->slug,
- 'paged' => $paged,
- 'cat' => '-12',
- 'posts_per_page' => 2,
- 'post__not_in' => array( $post->ID )
- );
- query_posts($args); ?>
- <?php $current_post_date = $post->post_date; ?>
- <?php if( have_posts() ) : while ( have_posts() ) : the_post(); ?>
- <?php if ($post->post_date < $current_post_date) { ?>
- <article>
- <figure>
- <?php
- $image_link=get_post_meta($post->ID,'Image_Link',true);
- if($image_link != '') {
- echo '<a href="http://example.com">'. get_the_post_thumbnail() .'</a>';
- } else {
- echo get_the_post_thumbnail();
- }
- ?>
- <figcaption>
- <?php
- // Call in the contents of a custom field called Credit and if custom field in admin panel is empty don't display <p> tags otherwise wrap contents of custom field in <p> tags
- $credit=get_post_meta($post->ID,'Credit',true);
- if($credit != '') {
- echo '<p>'. $credit .'</p>';
- } else {
- echo ' ';
- }
- ?>
- </figcaption>
- </figure>
- <?php
- $sub_title=get_post_meta($post->ID,'subtitle',true);
- if($sub_title != '') {
- echo '<h1>'. get_the_title() .'<span> / '. $sub_title . ' / ' . get_the_time('l jS F') .'</span></h1>';
- } else {
- echo '<h1>'. get_the_title() .'<span> / ' . get_the_time('l jS F') .'</span></h1>';
- }
- ?>
- <?php the_content(''); ?>
- <div class="a-options">
- <a href="#post-<?php the_ID(); ?>" class="comments scrollto">Comment</a>
- <!-- share -->
- <div class="share-button">
- <div class="buttons">
- <div class="facebook">
- <div class="fb-like" data-send="false" data-layout="button_count" data-width="450" data-show-faces="false" data-font="arial"></div>
- </div>
- <div class="twitter">
- <a href="https://twitter.com/share" class="twitter-share-button" data-text="<?php the_title(); ?>" data-url="<?php the_permalink(); ?>" data-via="kettlesyard" data-related="kettlesyard" data-hashtags="kettlesyard">Tweet</a>
- <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
- </div>
- <div class="pinterest">
- <a href="http://pinterest.com/pin/create/button/?url=<?php the_permalink(); ?>" class="pin-it-button" count-layout="horizontal"><img border="0" src="//assets.pinterest.com/images/PinExt.png" title="Pin It" /></a>
- </div>
- </div>
- <span class="pseudo-button">+ Share</span>
- </div> <!--! /share -->
- </div><!--! /a-options -->
- <?php if ( in_category( 'contact' ) ) : // Display nothing ?>
- <?php // Else, show comments
- else : ?>
- <?php global $withcomments;
- $withcomments = 1;
- comments_template(); ?>
- <?php endif; ?>
- </article>
- <?php } ?>
- <?php endwhile; ?>
- <div id="next-prev-wrap" class="nextprev"><?php next_posts_link(); ?> <?php previous_posts_link(); ?></div>
- <?php endif; wp_reset_query(); ?>
- </div>
- </section>
- <?php get_sidebar(); ?>
- </div> <!--! /main -->
- </div><!--/left-col -->
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement