• maidanet

    (@maidanet)


    I have created custom category templates (category-8.php, category-9.php, category-10.php, etc) so that each author has their bio at the top of their blog posts.

    I don’t want to publish a post just so I can see a preview of the category template.

    Shouldn’t the category template be viewable when my post is still a draft and I chose “Preview This Post”?

    If not, is there any other way (other than posting a test post to a live site) that I could preview my category templates?

Viewing 2 replies - 1 through 2 (of 2 total)
  • moshu

    (@moshu)

    Shouldn’t the category template be viewable when my post is still a draft and I chose “Preview This Post”?

    Absolutely not!
    The Category Templates are used by WP to display the category archives (or listing) and NOT the individual single posts. More in Template_Hierarchy.

    We all experiment and test themes (template files) on local installs or test installs in separate folders.

    Thread Starter maidanet

    (@maidanet)

    WordPress does have have a Preview Theme feature, so it is not so far-fetched to think that a category page preview is out of bounds.

    I did expect that my category template would be viewable when I went to that particular category even if there are no posts in that category. I put the additional HTML outside of The Loop.

    Have I misunderstood that as well?

    https://www.motherhoodwithattitude.com/category/guest-bloggers/
    (which is https://www.motherhoodwithattitude.com/?cat=3)

    category-3.php

    <?php get_header(); ?>
    <?php get_sidebar(); ?>
    <td bgcolor="#ffffff" width="560" align="center"><!--  S T A R T   M A I N   C O N T E N T  -->
    <table align="center" width="530"><tr><td class="content">
    <div align="right"><a href="<?php bloginfo('rss2_url'); ?>" title="<?php _e('Syndicate this site using RSS'); ?>"><img src="https://www.mozilla.org/images/feed-icon-14x14.png" alt="RSS Feed" title="RSS Feed" /></a></div>
    <table>
    <tr valign="top">
    	<td><img src="<?php bloginfo('url'); ?>/wp-content/uploads/2008/11/blogger_yolanda.jpg" width="137" height="125" alt="" border="0" align="right" hspace="5">
    	<b>Yolanda, Healing</b><br />
    	 I am a NJ-based freelance writer, belly dancer, massage therapist and musician! I have two children (ages 5 and 7) and have found myself on a journey in which healing is fueled by my art and vice versa.
    	<br clear="all">
    	<hr>
    	<br clear="all">
    	<img src="<?php bloginfo('url'); ?>/wp-content/uploads/2008/11/blogger_jody.jpg" width="137" height="125" alt="" border="0" align="right" hspace="5">
    	<b>Jody, Mom of 5 (teenagers on up!) and a grandmother</b><br />
    	 I am a pre-menopausal mother of five... two teenaged daughters, and three older sons, one of whom just completed his second tour in Iraq.  I have literally changed thousands of diapers in my years as a mother and more recently as a grandmother.  I dream... nay, I live for the day when the proverbial reversal of roles kick in and my kids have the pleasure of changing my diapers.
    	<br clear="all">
    	<hr>
    	<br clear="all">
    	<img src="<?php bloginfo('url'); ?>/wp-content/uploads/2008/11/blogger_hillary.jpg" width="137" height="125" alt="" border="0" align="right" hspace="5">
    	<b>Hillary , Mom of three, one of whom has autism</b><br />
    	 I am an eight-year veteran of motherhood with three boys: one Type A, one Type Z and one autistic (Type Q?). My main goal of each day is to make it through with a sense of humor and no martinis before noon. I live in the Midwest with my husband and boys and enjoy my role as the only female in the house!
    	<br clear="all">
    	</td>
    	<td><img src="<?php bloginfo('url'); ?>/wp-content/uploads/2008/11/blogger_yolanda.jpg" width="137" height="125" alt="" border="0" align="right" hspace="5">
    	<b>Dani, Mom of three, ages 4 to 17.</b><br />
    	 I am the mother of three kids who are loud enough to drown out a passenger jet, ages 17, 7 and 4. At this point I feel like I've 'been there, done that' with most everything related to parenthood aside from getting any of them OUT of the house. I spent most my life in the Denver area but currently live on another planet: Houston, Texas
    	<br clear="all">
    	<hr>
    	<br clear="all">
    	<img src="<?php bloginfo('url'); ?>/wp-content/uploads/2008/11/blogger_yolanda.jpg" width="137" height="125" alt="" border="0" align="right" hspace="5">
    	<b>Megan,</b><br />
    
    	<br clear="all">
    	<hr>
    	<br clear="all">
    	<img src="<?php bloginfo('url'); ?>/wp-content/uploads/2008/11/blogger_yolanda.jpg" width="137" height="125" alt="" border="0" align="right" hspace="5">
    	<b>Geri, Full-time working mom of 2-year-old twins and a 7-month-old</b><br />
    
    	<br clear="all">
    	</td>
    </tr>
    </table>
      <div id="main">
        <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
        <div class="post">
          <h3 class="storytitle" id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark">
            <?php the_title(); ?>
            </a></h3>
          <div class="meta">
            <?php the_date('','',''); ?> — <?php the_author() ?> @ <?php the_time() ?>
            <?php edit_post_link(__('Edit This')); ?>
          </div>
          <div class="storycontent">
            <?php the_content(__('(more...)')); ?>
          </div>
          <div class="feedback" align="right">
            <?php wp_link_pages(); ?>
            <?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?>
          </div>
          <!--  <?php // trackback_rdf(); ?>  -->
        </div>
    		<div class="postend">• • •</div>
        <?php comments_template(); // Get wp-comments.php template ?>
        <?php endwhile; else: ?>
        <p>
          <?php _e('Sorry, no posts matched your criteria.'); ?>
        </p>
        <?php endif; ?>
        <?php posts_nav_link(' — ', __('&laquo; Previous Page'), __('Next Page &raquo;')); ?>
      </div>
    </td></tr></table><!--  E N D   M A I N   C O N T E N T  -->
    <?php get_footer(); ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom category template preview’ is closed to new replies.