Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter gotax

    (@gotax)

    Resolved. My SQL query was perfect. The problem was in the add_action that WordPress still doesn’t recognize. In the end, I added the query to Blackbourn’s update_passwords function and added an extra action add_action('publish_post', array(&$this, 'update_passwords')); to handle automatic password assigning when a post is published.

    Hi,

    More or less sure what you’ve deemed as Older Posts (like 10 days old or more?) but it basically sounds like you want an archives.php page. Here’s an example of code I use for my archive of posts in a listed format displaying each post title, grouped by month :

    <?php
    $recentposts = get_posts('orderby=date&numberposts=-1');
    $m = $o = '';
    
    foreach ($recentposts as $post) :
    	setup_postdata($post);
    	if ($m != get_the_time('m')) { $m = get_the_time('m');
    		if (($m != $o) && ($o != '')) { echo '		</ul>'."\n"; } ?>
    
    		<h2 class="archive-title"><a href="/<?php the_time('Y/m'); ?>/"><?php the_time('F Y'); ?></a></h2>
    		<ul>
    <?php	} else { $o = $m; } ?>
    			<li>
    				<div class="date"><?php the_time('j') ?></div>
    				<h4><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h4>  (<?php comments_number(0, 1, '%', 'comments-link', '-'); ?>)
    			</li>
    
    <?php endforeach; ?>
    		</ul>

    It will list all posts (“numberposts=-1”) from the most recent one to the oldest one (“orderby=date”) . You can configure the page to not display, for example the 10 latest posts, by adding “offset=10” to the arguments sent by get_posts();

    In your “Older Posts” page, assign it a page template that includes the above code.

    I hope this is what you were looking for.

    Thread Starter gotax

    (@gotax)

    Bump (in case some people missed this).

    Thread Starter gotax

    (@gotax)

    (sorry if this post looked screwed up, I forgot to substitute the tags with unicode)

    I took a few days off from the theme… I got back to it and I found the culprit. The top navigation menu has a section that displays the 10 most recent posts… this is the code I used:

    <?php query_posts(‘showposts=10’); ?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    < li >
    <span class=”date”><?php the_time(‘n.j’) ?></span>
    <?php the_title() ?>
    < /li >
    <?php endwhile; endif; ?>

    And for some reason I don’t get its what was keeping the actual blog posts from displaying individually (same goes for the pages and searches and all). But I’m not sure how to fix it substitute it with something as functionnal.

    I’m currently using this code:
    <?php get_archives(‘postbypost’,’10’,’custom’,’ < li >’,'< /li >’); ?>

    But I would like for the list to also display the date next to each post title like in the original code.

    How do I go about doing that, or solving the previous code?

    Thread Starter gotax

    (@gotax)

    I switched them back to their default, but I’m still getting the same problem.

Viewing 5 replies - 1 through 5 (of 5 total)