Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Blogging Forum


You are currently viewing our Blogging Forum as a guest. Please register to participate.
Login



Reply
Creating an Archives Page
Old 02-15-2008, 02:30 PM Creating an Archives Page
jamestl2's Avatar
No scale-itch here...

Latest Blog Post:
Wordpress Relative URLs Plugin
Posts: 2,389
Name: <member type="brilliant" alt="foolish">James Lewitzke</member>
Location: / public_html / Universe / Virgo_Supercluster / Local_Group / Milky_Way / Orion_Arm / Solar_System / Earth / North_America / USA / Wisconsin
Trades: 0
I want to display my posts to have something like this:
Quote:
  • Year 1
    • Month 1
      • Post 1
      • Post 2
      • Post 3
    • Month 2
      • Post 1
      • Post 2
  • Year 2
    • Month 1
      • Post 1
      • Post 2
      • Post 3
      • Post 4
All the links would be clickable, so months would give me all the posts for that month, years would give posts from each month, etc.

I already have the actual page set up, All I need to do now is edit the code, here is what my current archives.php code is:

Code:
<?php 
    get_header();
    $alwayssidebars = get_option('royale_always_show_sidebars');
    if ($alwayssidebars) {
        if (get_option('royale_sidebar1_left')) include (TEMPLATEPATH . '/sidebar.php');
        if (get_option('royale_3columns') && get_option('royale_sidebar2_left')) {
            include (TEMPLATEPATH . '/sidebar2.php');
        }
    }
?>
    <td id="content" class="<?php echo ($alwayssidebars ? 'narrow' : 'wide'); ?>column">

        <?php if (have_posts()) : ?>

         <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
<?php /* If this is a category archive */ if (is_category()) { ?>
        <h2 class="pagetitle"><?php printf(__('Archive for the %s Category','royale'),single_cat_title('',false)); ?></h2>

       <?php /* If this is a daily archive */ } elseif (is_day()) { ?>
        <h2 class="pagetitle"><?php printf(__('Archive for %s','royale'),get_the_time(__('F jS, Y','royale'))); ?></h2>

     <?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
        <h2 class="pagetitle"><?php printf(__('Archive for %s','royale'),get_the_time(__('F, Y','royale'))); ?></h2>

        <?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
        <h2 class="pagetitle"><?php printf(__('Archive for %s','royale'),get_the_time('Y')); ?></h2>

      <?php /* If this is a search */ } elseif (is_search()) { ?>
        <h2 class="pagetitle"><?php _e('Search Results','royale'); ?></h2>

      <?php /* If this is an author archive */ } elseif (is_author()) { ?>
        <h2 class="pagetitle"><?php _e('Author Archive','royale'); ?></h2>

        <?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
        <h2 class="pagetitle"><?php _e('Blog Archives','royale'); ?></h2>

        <?php } ?>


        <div class="navigation">
            <div class="alignleft"><?php next_posts_link('&laquo; '. __('Previous Entries','royale')) ?></div>
            <div class="alignright"><?php previous_posts_link(__('Next Entries','royale'). ' &raquo;') ?></div>
        </div>

        <?php while (have_posts()) : the_post(); ?>
        <div class="post">
                                <div class="postinfo">
                        <div class="cal">
                                                <span class="cald<?php echo (get_option('royale_dates') ? ' cald2' : '') ?>"><?php the_time((get_option('royale_dates') ? 'M' : 'd')) ?></span>
                                                <span class="calm"><?php the_time((get_option('royale_dates') ? 'd' : 'm')) ?></span>
                                                <span class="caly"><?php the_time('Y') ?></span>
                                        </div>
                                        <h3 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s','royale'),the_title('','',false)); ?>"><?php the_title(); ?></a></h3>
                                        <small><?php printf(__('Posted by: %s in %s','royale'),'<a href="'. get_author_posts_url(get_the_author_ID()) .'" title="'. sprintf(__("Posts by %s"), attribute_escape(get_the_author())).' ">'. get_the_author() .'</a>',get_the_category_list(', ')) ?><?php edit_post_link(__('Edit','royale'), ' - '. mkicon('page_edit',__('Edit this post','royale')) .' ', ''); ?>  </small>
                                </div>

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

                <p class="postmetadata"><?php echo mkicon('comments','Comments'); ?> <?php comments_popup_link(__('No Comments','royale'). ' »', __('1 Comment','royale'). ' »', __('% Comments','royale'). ' »'); ?></p>

            </div>

        <?php endwhile; ?>

        <div class="navigation">
            <div class="alignleft"><?php next_posts_link('&laquo; '. __('Previous Entries','royale')) ?></div>
            <div class="alignright"><?php previous_posts_link(__('Next Entries','royale'). ' &raquo;') ?></div>
        </div>

    <?php else : ?>

        <h2 class="center"><?php _e('Not Found','royale'); ?></h2>
        <p class="center"><?php _e('Sorry, but you are looking for something that isn\'t here','royale'); ?>.</p>

    <?php endif; ?>

    </td>

<?php
    if ($alwayssidebars) {
        if (!get_option('royale_sidebar1_left')) include (TEMPLATEPATH . '/sidebar.php');
        if (get_option('royale_3columns') && !get_option('royale_sidebar2_left')) {
            include (TEMPLATEPATH . '/sidebar2.php');
        }
    }

    get_footer(); 
?>
I'm not really sure what to change here. I could make out some of it, like the "get sidebar's portion, I wouldn't change that, just not sure about the other parts.

When I create the page with the above code, it gives me a search function (don't want that), a list of months (which would be edited with the new format), and it gives me an archives by subject (don't want that either).
__________________
Engipress -
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
for Wordpress Projects
jamestl2 is offline
Reply With Quote
View Public Profile Visit jamestl2's homepage!
 
 
Register now for full access!
Old 02-17-2008, 03:07 PM Re: Creating an Archives Page
ssandecki's Avatar
SEO Addict

Latest Blog Post:
Wordpress SEO Plugins
Posts: 295
Name: Stephen
Location: Chicago, IL
Trades: 0
www.learnphpfree.com/
__________________

Please login or register to view this content. Registration is FREE
- Learn how to get a cash advance on your pending lawsuit; if you lose your lawsuit you don't pay it back!
ssandecki is offline
Reply With Quote
View Public Profile Visit ssandecki's homepage!
 
Old 02-17-2008, 03:46 PM Re: Creating an Archives Page
jamestl2's Avatar
No scale-itch here...

Latest Blog Post:
Wordpress Relative URLs Plugin
Posts: 2,389
Name: <member type="brilliant" alt="foolish">James Lewitzke</member>
Location: / public_html / Universe / Virgo_Supercluster / Local_Group / Milky_Way / Orion_Arm / Solar_System / Earth / North_America / USA / Wisconsin
Trades: 0
Is something like this really too complicated for knowledgeable PHP users to help out with?

You could hypothetically post that link in every thread over in the PHP forum .
__________________
Engipress -
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
for Wordpress Projects

Last edited by jamestl2; 02-17-2008 at 03:51 PM..
jamestl2 is offline
Reply With Quote
View Public Profile Visit jamestl2's homepage!
 
Old 02-18-2008, 12:32 AM Re: Creating an Archives Page
ssandecki's Avatar
SEO Addict

Latest Blog Post:
Wordpress SEO Plugins
Posts: 295
Name: Stephen
Location: Chicago, IL
Trades: 0
Quote:
Originally Posted by jamestl2 View Post
Is something like this really too complicated for knowledgeable PHP users to help out with?

You could hypothetically post that link in every thread over in the PHP forum .
Well, considering this wasn't in the coding thread that was the best answer you were gonna get. Considering posting it in the correct sub-forum and you might get the correct answer.

Might also help if you provided an output page of the code your displaying.
__________________

Please login or register to view this content. Registration is FREE
- Learn how to get a cash advance on your pending lawsuit; if you lose your lawsuit you don't pay it back!

Last edited by ssandecki; 02-18-2008 at 12:33 AM..
ssandecki is offline
Reply With Quote
View Public Profile Visit ssandecki's homepage!
 
Old 02-18-2008, 12:38 AM Re: Creating an Archives Page
jamestl2's Avatar
No scale-itch here...

Latest Blog Post:
Wordpress Relative URLs Plugin
Posts: 2,389
Name: <member type="brilliant" alt="foolish">James Lewitzke</member>
Location: / public_html / Universe / Virgo_Supercluster / Local_Group / Milky_Way / Orion_Arm / Solar_System / Earth / North_America / USA / Wisconsin
Trades: 0
Well this IS the blogging forum, and my issue is related to my blog, powered by wordpress.

I was also thinking that there might have been a better alternative to hard coding, such as a plugin I may have missed, or even someone else who has done this exact same thing for their blog.

Also, I haven't technically "Published" that page yet. The code that is displayed above is from when I give a new page the archive template.
__________________
Engipress -
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
for Wordpress Projects
jamestl2 is offline
Reply With Quote
View Public Profile Visit jamestl2's homepage!
 
Old 02-18-2008, 03:38 PM Re: Creating an Archives Page
ForrestCroce's Avatar
Half Man, Half Amazing

Posts: 3,023
Name: Forrest Croce
Location: Seattle, WA
Trades: 0
Quote:
Originally Posted by jamestl2 View Post
Is something like this really too complicated for knowledgeable PHP users to help out with?
I don't have too much php experience, and a lot of the wp hacking I've done has been less aggressive. Someone else will have to chime in with how to make the dates hierarchal.

As for why the search is showing up, you have a code block near the top starting with:

PHP Code:
 if ($alwayssidebars
It's calling out to other template files. Near the bottom, you have some 404 code.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
ForrestCroce is offline
Reply With Quote
View Public Profile Visit ForrestCroce's homepage!
 
Old 02-18-2008, 03:47 PM Re: Creating an Archives Page
jamestl2's Avatar
No scale-itch here...

Latest Blog Post:
Wordpress Relative URLs Plugin
Posts: 2,389
Name: <member type="brilliant" alt="foolish">James Lewitzke</member>
Location: / public_html / Universe / Virgo_Supercluster / Local_Group / Milky_Way / Orion_Arm / Solar_System / Earth / North_America / USA / Wisconsin
Trades: 0
I'm guessing to get rid of the search box, I'll have to delete all this code, right?

PHP Code:
    if ($alwayssidebars) {
        if (
get_option('royale_sidebar1_left')) include (TEMPLATEPATH '/sidebar.php');
        if (
get_option('royale_3columns') && get_option('royale_sidebar2_left')) {
            include (
TEMPLATEPATH '/sidebar2.php');
        }
    } 
__________________
Engipress -
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
for Wordpress Projects

Last edited by jamestl2; 02-18-2008 at 03:48 PM..
jamestl2 is offline
Reply With Quote
View Public Profile Visit jamestl2's homepage!
 
Old 02-20-2008, 11:24 PM Re: Creating an Archives Page
ForrestCroce's Avatar
Half Man, Half Amazing

Posts: 3,023
Name: Forrest Croce
Location: Seattle, WA
Trades: 0
Well ... do you want to include other things around it?

If I were you, I'd save the file, or copy it to the clipboard, gut that section, then see what happens. Your theme looks a bit more complicated than mine, so I'm not 100 % sure. But I kind of get the feeling you'll loose more than just your search form if you remove all of that. Maybe that's what you want, though; it's talking about pulling in files with sidebar in the name, so I'm guessing that's also the archives - useless on an archives page - categories and tags.

Probably the easiest way, if that doesn't work, would be with css and display: none. That's cheating, but ... probably better than duplicating everything for just one page.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
ForrestCroce is offline
Reply With Quote
View Public Profile Visit ForrestCroce's homepage!
 
Old 02-20-2008, 11:32 PM Re: Creating an Archives Page
jamestl2's Avatar
No scale-itch here...

Latest Blog Post:
Wordpress Relative URLs Plugin
Posts: 2,389
Name: <member type="brilliant" alt="foolish">James Lewitzke</member>
Location: / public_html / Universe / Virgo_Supercluster / Local_Group / Milky_Way / Orion_Arm / Solar_System / Earth / North_America / USA / Wisconsin
Trades: 0
You've probably got more php experience than I do , so I wouldn't know what I'd be removing. I was just guessing on what to take out or not, since you posted the
if ($alwayssidebars) code.

Actually the structure I listed in the OP, I'd want in page form (as in all my sidebars, header, footer, etc. would still be there), it would just be another link in the header (along with disclaimer, home, etc.).
__________________
Engipress -
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
for Wordpress Projects
jamestl2 is offline
Reply With Quote
View Public Profile Visit jamestl2's homepage!
 
Old 02-21-2008, 05:16 PM Re: Creating an Archives Page
jamestl2's Avatar
No scale-itch here...

Latest Blog Post:
Wordpress Relative URLs Plugin
Posts: 2,389
Name: <member type="brilliant" alt="foolish">James Lewitzke</member>
Location: / public_html / Universe / Virgo_Supercluster / Local_Group / Milky_Way / Orion_Arm / Solar_System / Earth / North_America / USA / Wisconsin
Trades: 0
Alright, I was able to solve it using this plugin (I knew it was out there somewhere):
http://www.geekwithlaptop.com/projects/clean-archives/
__________________
Engipress -
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
for Wordpress Projects

Last edited by jamestl2; 02-21-2008 at 07:48 PM..
jamestl2 is offline
Reply With Quote
View Public Profile Visit jamestl2's homepage!
 
Reply     « Reply to Creating an Archives Page
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.56208 seconds with 12 queries