Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Center area post/pages (http://forum.bytesforall.com/forumdisplay.php?f=32)
-   -   Add Category/Tag/Date/etc... to Page Tops (http://forum.bytesforall.com/showthread.php?t=5399)

kbisignani Jan 19, 2010 05:05 PM

Add Category/Tag/Date/etc... to Page Tops
 
I apologize if this has been answered elsewhere in advance - I did try to search my way through and came up empty.

I am trying to add a title to a multi-post page, like the Category name, or the Tag name, when someone clicks on a Category or a Tag.

I think I'm close - if I understand the theme correctly, the spot this *should* go in would be in the "Style and edit CENTER COLUMN" section, in the "Content ABOVE the LOOP" area.

The problem is I see no method of telling the theme I want that listed at the top.

I'm starting to think I need some sort of PHP code and pull in a variable from WordPress itself - however I don't know WordPress well enough to even know where to dig up that information.

I noticed that this information is *sort of* listed in the actual title of the page (at the top of the browser window) although things like Dates I'd like to format a little nicer.

Is there a method of doing this? Am I just missing a simple option somewhere?

Thank you very much for anyone who can help!

kbisignani Jan 19, 2010 05:39 PM

So I may have answered my own question. I looked in to another Theme with the category titles in it correctly and dug out the following code:
Code:

      <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
      <?php /* If this is a category archive */ if (is_category()) { ?>
      <h1 class="title archive-category"><?php echo single_cat_title(); ?></h1>
      <?php /* If this is a tag archive */ } elseif(is_tag()) { ?>
      <h1 class="title archive-tag"><?php printf( __('Posts tagged %s', 'mystique'), '<span class="altText">'.single_cat_title('', false).'</span>'); ?></h1>
      <?php /* If this is a daily archive */ } elseif (is_day()) { ?>
      <h1 class="title archive-day"><?php  printf(__('Archive for %s', 'mystique'), '<span class="altText">'.get_the_time(get_option('date_format')).'</span>');  ?></h1>
      <?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
      <h1 class="title archive-month"><?php  printf(__('Archive for %s', 'mystique'), '<span class="altText">'.get_the_time(__('F, Y','mystique')).'</span>');  ?></h1>
      <?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
      <h1 class="title archive-year"><?php  printf(__('Archive for year %s', 'mystique'), '<span class="altText">'.get_the_time(__('Y','mystique')).'</span>');  ?></h1>
      <?php /* If this is an author archive (should never show because the author template exists... */ } elseif (is_author()) { ?>
      <h1 class="title archive-author"><?php _e('Author archive','mystique'); ?></h1>
      <?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
      <h1 class="title"><?php _e('Blog Archives','mystique'); ?></h1>
      <?php } ?>

I've thrown that in - I'll want to clean up the formatting but I think this'll do it for me. Sorry for the post. Hopefully someone else will find this beneficial :)

meggo Feb 8, 2010 04:57 PM

Hey, I have no idea how to get this to work. Can you break this down into a couple steps on how I can implement this into my site? I want to make one of my categories into a page.


All times are GMT -6. The time now is 08:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.