Trouble with conditional category tags in index page
-
I’m trying to create a tumblelog based on these instructions at Openswitch and I can’t even get past the first bit of code. I am using a slightly modified version of the Tiny theme, which I’d like to modify further into a tumblelog format.
My index looks like this:
<?php // index.php // Tiny theme for WordPress // Copyright (C) 2005 Ben de Groot // Distributed under the terms of the GNU General Public License v2 get_header(); // Check if the sitemap is requested if ( isset($_GET['sitemap']) ) { include('sitemap.php'); } else { if (have_posts()) : while (have_posts()) : the_post(); ?> <h2 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php _e('Permanent Link','bnTiny'); ?>: <?php the_title(); ?>"><?php the_title(); ?></a></h2> <p class="posted"><?php the_date('', '', ' at', TRUE); ?> <?php the_time(); ?> | <?php the_category(', '); ?> | <?php comments_popup_link( __('No Comments','bnTiny'), __('1 Comment','bnTiny'), __('% Comments','bnTiny') ); ?> <?php edit_post_link($link = __('Edit','bnTiny'), $before = ' | ', $after = ''); ?></p> <?php the_content(); ?><br /> <?php endwhile; ?> <p class="nav"><span class="prev"><?php posts_nav_link( '', '', __('« Previous Entries','bnTiny') ) ?></span> <span class="next"><?php posts_nav_link( '', __('Next Entries »','bnTiny'), '' ) ?></span></p> <?php else: ?> <p><?php _e('Sorry, nothing found.','bnTiny'); ?></p> <?php endif; ?> <?php } get_footer(); ?>
I am trying to paste the first conditional code:
<?php if ( in_category(4) && !is_single() ) : ?> <div class=“post”> <span class=“permalink”> <a href=”<?php the_permalink() ?>” rel=“bookmark” title=“Permanent Link to <?php the_title(); ?>”>¶</a></span> <div class=“post_body”> <div class=“conversation”> <?php the_content(); ?> </div> </div> </div>
in there somewhere but no matter where I put it I come up with a syntax error. I don’t know a whole lot about PHP but I thought I knew more than this. Help please!
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Trouble with conditional category tags in index page’ is closed to new replies.