Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Atahualpa 3 Wordpress theme (http://forum.bytesforall.com/forumdisplay.php?f=2)
-   -   Add additional filters to Archive Page (http://forum.bytesforall.com/showthread.php?t=2698)

JournalStone Jul 28, 2009 10:06 AM

Add additional filters to Archive Page
 
Atahualpa 3.4

Is it possible to add additional filters on the archive page? Currently I am displaying Archives by Month and Archives by Category. I'd like to also display Archives by Tags. Is this possible? If so, could it be formatted in an additional column?

http://journalstone.com/archives/

Thanks.

Flynn Aug 6, 2009 01:36 PM

I suggest to create a new page template instead of editing functions/bfa_post_parts.php, which is where the code for the default archives page is located.

To create a archives page template, create a new file in a text editor and paste this content into it:

PHP Code:

<?php /*
Template Name: Archives
*/ 
?>
<?php     
/* get all options: */
include (TEMPLATEPATH '/functions/bfa_get_options.php');
get_header(); ?>
<table id="myarchive" border="0" cellspacing="0" cellpadding="0">
<colgroup>
    <col style="width:33%">
    <col style="width:33%">
    <col style="width:34%">
</colgroup>
<tr>
<td>
    <h3>By Date</h3>
    <ul>
    <?php wp_get_archives('type=monthly&show_post_count=1&limit=0'); ?>
    </ul>
    </td>
<td>
    <h3>By Category</h3>
    <ul>
    <?php wp_list_categories('title_li=&orderby=name&order=ASC&show_count=1&depth=0&feed_image=' 
    
get_bloginfo('template_directory') . '/images/icons/feed.gif' '')); ?>
    </ul>
</td>
<td>
    <h3>By Tag</h3>
    <ul>
    <?php wp_tag_cloud('format=list&orderby=count&unit=px&smallest=12&largest=12&number=0'); ?>
    </ul>
</td>
</tr>
</table>
<?php get_footer(); ?>

Save the file as archives.php and upload it into the Atahualpa directory on your web hosting account.

If every column gets the same width anyway, then this part

PHP Code:

<col style="width:33%">
<
col style="width:33%">
<
col style="width:34%"

can be replaced with the shorter:

PHP Code:

<col><col><col

in the above code.

To customize the output for each one of the three lists, see http://codex.wordpress.org/Template_Tags/wp_tag_cloud,
http://codex.wordpress.org/Template_...ist_categories and http://codex.wordpress.org/Template_...p_get_archives.

To style the columns, use a CSS insert to add styling to the <TD> columns of the table

PHP Code:

table#myarchive td {
    
vertical-aligntop;
    
background#eeeeee;
    
bordersolid 1px #cccccc;
    
padding10px;


The width of the columns must be controlled through the "col" selector

PHP Code:

<col style="width:33%"

This does not have to be inline, you could also use:

<col class="col1">

plus a CSS Insert:

PHP Code:

col.col1 {
    
width200px;



Create a page in Wordpress with a title but no content and choose "Archives" as the page template in the drop down select menu at the top right of the "Posts" -> "Edit" or "Add New" page.

JournalStone Aug 7, 2009 09:02 AM

Flynn,

You rock! I'll play with this over the weekend.

Thanks!

JournalStone


All times are GMT -6. The time now is 11:23 PM.

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