Forum Replies Created

Viewing 3 replies - 61 through 63 (of 63 total)
  • Not sure what you looked at (I couldn’t find the Post Classes function).

    But I did something similar on my theme. Use this in The Loop inside the php file(s) in question (most likely home, index, category, and archive) and it should work.

    <?php if (have_posts()) : ?>
    	<!-- new variable for post count -->
    	<?php $i = 1; ?>
    
    	<!-- begin THE LOOP -->
    	<?php while (have_posts()) : the_post(); ?>
       			<!-- increments post count with each post -->
    	    	<?php $i++; ?>
    
    	        <div class="<?php the_ID(); ?><?php if ($i == 3 || $i == 6 || $i == 9 || $i == 12 ) { ?> thirdpost_class<?php  } ?>">
    	        <h2 class="archive-header"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title() ?></a></h2>
    	                <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
    						<?php the_title();?>
    					</a>
    	        		<?php the_excerpt(); ?>
    	        		<p class="postmetadata"><?php the_time('M d, Y') ?></p>
    	        </div>
    <!-- end THE LOOP -->
    <?php endwhile; ?>
    <?php endif; ?>

    Also, see The Loop in Action for more detail on how to customize The Loop.

    I found a solution for the first problem (getting the templates to show up in the template select list in the “quick edit” menu) in another thread.

    Oddly enough, switching to the default theme and back to the theme you are working on made the new templates show up in the list under “quick edit”. Why_is_there_no_Page_Template_option_when_writing_or_editing_a_Page

    However, the page I applied the custom template to (a page titled “blog” which is set to display my most recent posts) is not using the custom template. I put in some static code to see if it came through on the page, but it does not.

    (I’d provide a link if I could, but I’m developing the theme locally before I launch it.)

    I’m having the same issue creating a theme from scratch.

    The header for my template file (called blog-archive.php) reads:

    <?php
    /**
     * @package WordPress
     * @subpackage bxd_Theme
     */
    /*
    Template Name: Blog-Archive
    */
    
    get_header();
    ?>

    But still the only option for template is “Default Template”.

    I’m on WP 2.9.2 as well.

Viewing 3 replies - 61 through 63 (of 63 total)