• I am currently using the wp theme template: Comet 1.4.2 by Frostpress

    I want to add a date stamp graphic that would appear next to each one of my posts, similar to these templates:
    Bueno 1.5.1 by WooThemes or:
    LightWord 1.9.9.7 by Andrei Luca

    Does anyone have any idea how I would go about doing this?

Viewing 7 replies - 1 through 7 (of 7 total)
  • I assume you know basic HTML/CSS and can hack your way around a PHP file (it’s easy, if you don’t get it, just Google it or post back), right 😉

    Just navigate (with a file browser, not a web browser) to /wordpress-install-directory/wp-content/themes and open up your theme folder.

    index.php is the middle part of your site, so open that up in a text editor.

    Look at your other themes, see what code makes the stamp (I make themes, so I can help if you are really stuck), and add it. I don’t know what else to say…

    download these free themes for instance, and look into the code how it is done.

    Thread Starter dustym

    (@dustym)

    Blender3D:
    I found the index.php files for both files, but there is not much there. Here is the index file for the template whose date stamp I want to use:

    <?php get_header(); ?>

    <div id=”content” class=”col-full”>
    <div id=”main” class=”col-left”>

    <?php $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; query_posts(“post_type=post&paged=$paged”); ?>
    <?php if (have_posts()) : $count = 0; ?>
    <?php while (have_posts()) : the_post(); $count++; ?>

    <div class=”post”>

    <h2 class=”title”>” rel=”bookmark” title=”<?php the_title(); ?>”><?php the_title(); ?></h2>

    <p class=”date”>
    <span class=”day”><?php the_time(‘j’); ?></span>
    <span class=”month”><?php the_time(‘M’); ?></span>
    </p>

    <?php woo_get_image(‘image’,490,200); ?>

    <div class=”entry”>
    <?php the_content(); ?>
    </div>

    <div class=”post-meta”>

      <li class=”comments”>
      <span class=”head”><?php _e(‘Comments’, ‘woothemes’) ?></span>
      <span class=”body”><?php comments_popup_link(__(‘0 Comments’, ‘woothemes’), __(‘1 Comment’, ‘woothemes’), __(‘% Comments’, ‘woothemes’)); ?></span>

      <li class=”categories”>
      <span class=”head”><?php _e(‘Categories’, ‘woothemes’) ?></span>
      <span class=”body”><?php the_category(‘, ‘) ?></span>

      <li class=”author”>
      <span class=”head”><?php _e(‘Author’, ‘woothemes’) ?></span>
      <span class=”body”><?php the_author_posts_link(); ?></span>

    <div class=”fix”></div>

    </div><!– /.post-meta –>

    </div><!– /.post –>

    <?php endwhile; else: ?>
    <div class=”post”>
    <p><?php _e(‘Sorry, no posts matched your criteria.’, ‘woothemes’) ?></p>
    </div><!– /.post –>
    <?php endif; ?>

    <div class=”more_entries”>
    <?php if (function_exists(‘wp_pagenavi’)) wp_pagenavi(); else { ?>
    <div class=”fl”><?php next_posts_link(__(‘« Older Entries’, ‘woothemes’)) ?></div>
    <div class=”fr”><?php previous_posts_link(__(‘Newer Entries »’, ‘woothemes’)) ?></div>
    <br class=”fix” />
    <?php } ?>
    </div>

    </div><!– /#main –>

    <?php get_sidebar(); ?>

    </div><!– /#content –>

    <?php get_footer(); ?>

    this is the html part of the date display:

    <p class="date">
    <span class="day"><?php the_time('j'); ?></span>
    <span class="month"><?php the_time('M'); ?></span>
    </p>

    the rest is in the style.css and in the images folder of the theme:

    edit style.css an look for:

    .date {  }
    .date span.day {   }
    etc.

    or similar.

    these styles are likely to have background images referenced;
    look for these images in the images folder of the theme.

    Thread Starter dustym

    (@dustym)

    Where on my index page do I paste the new code?

    where do you want the date to show?

    look again ito your example file, and see that they have the code for the date just after the line with ‘the_title()’:

    <h2 class="title"><a href="<?php....?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>

    `<span class=”post-date”><?php the_date(‘F j, Y’); ?></span>

    Place that where you want the date, and just edit the stylesheet to make it look good. Make sure it is inside The Loop, but I doubt you want the date above all of the posts…

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Adding custom graphic to theme template’ is closed to new replies.