Forum Replies Created

Viewing 15 replies - 1 through 15 (of 39 total)
  • However, given the fact that you discuss art, the color palette should use more color as well

    I’d argue the exact opposite. Let the art stand as the focus and the design act as a stage in the background.

    Thread Starter wibu

    (@wibu)

    OK, played with it. Come up with a crude way of doing it, it’s not efficient but it works and I’m not expecting it to be a high load site so it’s fine for now.

    Again, thanks a lot Michael.

    Thread Starter wibu

    (@wibu)

    As an update to the previous post. Formatting is all sorted but there is one last issue… and it’s the ordering.

    With this:
    <?php
    //for use in single.php (if used other places need to set $currentid)
    //get all posts and then display certain number ($num_old_new) of posts dated before this post, and same number of posts dated after this post.
    //
    $num_old_new = 5; // max number of older posts to show. Also will be max number of newer posts to show.
    $newer_title = '<p class="single top">Next';
    $older_title = '</p><p class="single top">Previously';
    $currentid = $posts[0]->ID;
    $thisone = 0;

    $args=array(
    'orderby' => 'date',
    'order' => 'ASC',
    'post_type' => 'post',
    'post_status' => 'publish',
    'showposts'=>-1,
    'caller_get_posts'=>1
    );

    $allposts = get_posts($args);

    if ($allposts) {
    for ( $counter = 0; $counter <= count($allposts); $counter += 1) {
    if ( $allposts[$counter]->ID == $currentid ) {
    $thisone = $counter;
    }
    }
    $begin = 0;
    $end = count($allposts) - 1;

    if ( $thisone - $num_old_new >= $begin ) {
    $begin = $thisone - $num_old_new;
    }

    if ( $thisone + $num_old_new <= $end ) {
    $end = $thisone + $num_old_new;
    }

    for ( $counter = $begin; $counter <= $end; $counter += 1) {
    if ( $allposts[$counter]->ID != $currentid ) {
    $post = $allposts[$counter];
    setup_postdata($post);

    if ( $counter > $thisone && $newer_title ){ //display newer title once
    echo $newer_title;
    $newer_title = '';
    }

    if ( $counter < $thisone && $older_title ){ //display older title once
    if (!$newer_title) { } else {$older_title = '<p class="single top">Previously';}
    echo $older_title;
    $older_title = '';
    }

    ?> • " rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?><?php

    }
    }
    }
    ?></p>
    <?php wp_reset_query(); //just in case
    ?>

    It orders the “Next” correctly but “Previous” is sorted in reverse chronological, the previous post is the furthers to the right instead of being next to the title “Previous”.

    Any ideas on how to sort that out or is it a flaw with how it’s all done?

    Any idea how to separate the two objectives? Having one do Next ordered in ascending and Previous ordered in descending?

    Thread Starter wibu

    (@wibu)

    Genius. Thanks a lot (and I really mean it).

    Haven’t tested yet, but it seems like it’ll work. Slowly slowly learning PHP; I’ll try and work out where to put it.

    Edit:

    OK, one slight issue with the ordering. Is there any way to have it so it is ascending for the newer and descending for the older?

    Thread Starter wibu

    (@wibu)

    That was the first thing I tried. It just ended up giving me problems with closing the tags out. I realise it could just be as simple as opening the p tag with the $newer_title and $older_title, the issue comes with closing them off without relying on either one existing; at the first post or last post where newer or older doesn’t exist.

    I was wondering if it was possible copy/manipulate this:

    if ( $counter < $thisone && $newer_title ){ //display newer title once
          echo $newer_title;
          $newer_title = '';
          }

    Using a similar method to count to insert a /p closing tag at the end of the generated lists.

    Thread Starter wibu

    (@wibu)

    OK, updated code works perfectly.

    I hate to ask for one last thing, but I’m having no luck myself.

    How would I change the code so that the output is something along the lines of:

    <p>Previously: &bull; [Code for 1] &bull; [Code for 2] &bull; [Code for 3] &bull; [Code for 4] &bull; [Code for 5]</p><br />
    <p>Next: &bull; [Code for 1] &bull; [Code for 2] &bull; [Code for 3] &bull; [Code for 4] &bull; [Code for 5]</p>

    I’m sure it only involves a quick check, similar to the insertion of the titles, but I’m clueless as to how to do it. It’s essentially just adding a /p to the end of the output.

    Thread Starter wibu

    (@wibu)

    Ok, having no luck.

    Also attempting to spit newer/older up and having no luck. Playing around with the code, removing different things to see what disappears, not being successful.

    Thread Starter wibu

    (@wibu)

    Wow, totally unexpected but big thanks.

    Playing with it now. I’m sure I can find a way to not have the newer message not appear when there are no new posts. Will post back with what I come up with (if I come up with anything).

    Thread Starter wibu

    (@wibu)

    Thanks for the hints but I’m probably more lost than I was before I attempted to get something out of that. I’m a dab hand with html and js but php is a lot art for me at the moment.

    Unless someone can pretty much write it up for me, or give me a close to complete example, it looks like I’ll have to scale back what I wanted to achieve.

    Thread Starter wibu

    (@wibu)

    Thanks for the reply but it’s not exactly what I’m looking for (I’m already using that for my archive pages).

    I’m looking for something for the single post page that allows me to list the next 5 posts and the previous 5 posts.

    I’m not sure if it can be done via a loop query, if it can, I haven’t found it.

    Appologies for the bump but I’ve found <?php the_excerpt_rss(); ?> gives you an unfiltered excerpt, the only difference is no <p> tags…

    As far as I can tell anyway.

    You’ve got a lot of empty elements which you aren’t closing; 3 span’s and 11 li’s. That’s what’s most likely making IE render it so badly.

    Thread Starter wibu

    (@wibu)

    Just a quick update…

    I’ve fixed the issue by using a css “trick”. I just set br to display:none and it seems to have had the desired effect.

    It’s not perfect but it will do for now.

    Thread Starter wibu

    (@wibu)

    “If you have recently upgraded to WP 2.1, maybe some files were left on the server?”

    I upgraded to 2.1 the day it was released.

    Anyway, I’d already followed most of your tips to no avail but it’s all sorted now as I said in the post above yours…

    “I uploaded the default theme, chose it, then switched back to my theme. Seems to be working fine now.”

    Thread Starter wibu

    (@wibu)

    I’ve “found” the solution. I uploaded the default theme, chose it, then switched back to my theme. Seems to be working fine now.

Viewing 15 replies - 1 through 15 (of 39 total)