Created
December 1, 2013 14:47
-
-
Save slambert/7734845 to your computer and use it in GitHub Desktop.
Category.php page from my site
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php get_header() ?> | |
<!-- created with category.php --> | |
<?php get_sidebar() ?> | |
<hr /> | |
<div id="content"> | |
<!--checking if this is a for sale page--> | |
<?php | |
if (is_category(10)): | |
// looking for category 10 (for sale) posts | |
?> | |
<!--It is a for sale page --> | |
<h2>This isn't everything</h2> | |
<p>Though not listed here, most objects I've made are available. The more recent sign work is available through me or <a href="http://cjamesgallery.com">Charlie James Gallery</a> in Los Angeles. If you have any questions, <a href="http://visitsteve.com/contact">get in touch</a>.</p> | |
<div class="horiz-bar"> | |
<img src="<?php bloginfo('stylesheet_directory'); ?>/images/end-post.gif" height="2" width="162" alt="--" /></div> | |
<?php else: ?> | |
<!--done checking and this is art or news. Carry on.--> | |
<?php endif; // end that check of for sale categories ?> | |
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> | |
<?php | |
if (is_category(array(1,15,16,94))): | |
// looking for news, talks, exhibitions, or press posts | |
?> | |
<!-- This is news or something like it --> | |
<h2 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2> | |
<div class="date"><?php the_date(); ?></div> | |
<div class="meta"><?php _e(""); ?> <?php edit_post_link(); ?></div> | |
<div class="storycontent"> | |
<?php the_content('Read on...'); ?> | |
</div><!-- .storycontent --> | |
<div class="horiz-bar"> | |
<img src="<?php bloginfo('stylesheet_directory'); ?>/images/end-post.gif" height="2" width="162" alt="--" /> | |
<?php wp_link_pages(); ?> | |
</div><!-- .horiz-bar --> | |
<?php else: ?> | |
<?php /* this is definitely art */ ?> | |
<div class="storycontent"> | |
<table border="0"> | |
<tr> | |
<td width="300px"> | |
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title_attribute(); ?>"> | |
<?php | |
#If there is a post thumbnail , it will display. If not it is the thumb function. These | |
# can be edited in the functions.php file. | |
if(has_post_thumbnail()){ | |
the_post_thumbnail(); | |
} | |
else{ | |
echo $post->post_excerpt; | |
} | |
?> | |
</a> | |
</td> | |
<td valign="middle"> | |
<h2 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2> | |
<div class="date"><?php the_date(); ?></div> | |
</td> | |
</tr> | |
</table> | |
</div> | |
<div class="horiz-bar"> | |
<img src="<?php bloginfo('stylesheet_directory'); ?>/images/end-post.gif" height="2" width="162" alt="--" /></div> | |
<?php endif; // end checking for news categories ?> | |
<?php endwhile; else: ?> | |
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p> | |
<?php endif; ?> | |
<div class="center"><?php posts_nav_link(' || ', __('« Previous'), __('Next »')); ?></div> | |
</div> | |
<?php get_footer(); ?> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment