The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

make photoblog list only from 1 category (1 post)

  1. jivyb
    Posted 10 years ago #

    Hi. Can anyone help me limit this code so the "previous" and "next" links only point to category 3?

    I've searched the forum and docs and am hung up but I'd like to learn if someone knows how.


    <div class="entry">

    <!-- content with link to previous post -->
    <?php global $post, $tableposts;
    $previous = @$wpdb->get_var("SELECT ID FROM $tableposts WHERE post_date < '$post->post_date' AND post_status = 'publish' ORDER BY post_date DESC LIMIT 0, 1");
    if ($previous) {
    $link = get_permalink($previous);
    echo '' . $post->post_content . '
    } else {
    the_content('[more photos]');
    } ?>

Topic Closed

This topic has been closed to new replies.

About this Topic