Forums

[resolved] Offset not working in category page (4 posts)

  1. amobaroti
    Member
    Posted 1 year ago #

    I have a category page that shows an excerpt of the most recent post and then a short post description of the next three. However for some reason thecode to show the post description includes the main post even thought I have used 'offset=1'. I must mention that it had been working previously. I am clueless. Help please.

    Here's a link to the page. Not quie finished, Its just a mock at the moment: http://www.olorimag.com/category/absolutely-loving-this/

    '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>

    <title>Olori - lifestyle, culture of the affluent Christian</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="keywords" content="" />

    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    <!--[if IE]><link rel="stylesheet" href="blueprint/ie.css" type="text/css" media="screen, projection" /><![endif]-->

    </head>

    <body>

    <?php get_header(); ?>
    <div class="container">

    <div class="span-15">

    <div class="inside">
    <h1 class="small"><span>THE HEADLINE</span></h1>

    </div>

    <div class="inside">
    <h1 class="small"><span> PREVIOUS ABSOLUTELY LOVING THIS</span></h1>

    <?php $my_query = new WP_Query('showposts=2&offset=1'); ?>

      <?php while(have_posts()) : the_post(); // check for thumbnail
      $thumb = get_post_meta($post->ID, 'Thumbnail', $single = true);
      // check for thumbnail class
      $thumb_class = get_post_meta($post->ID, 'Thumbnail Class', $single = true);
      // check for thumbnail alt text
      $thumb_alt = get_post_meta($post->ID, 'Thumbnail Alt', $single = true);?>

      <li class="inside postbox"><?php // if there's a thumbnail
      if($thumb !== '') { ?>
      <p>
      <img src="<?php echo $thumb; ?>"
      class="<?php if($thumb_class !== '') { echo $thumb_class; } else { echo "left"; } ?>"
      alt="<?php if($thumb_alt !== '') { echo $thumb_alt; } else { echo the_title(); } ?>"
      />
      </p>
      <?php } // end if statement

      // if there's not a thumbnail
      else { echo ''; } ?>
      <h1>>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></h1>

      <?php
      $Post_desc = get_post_meta($post->ID, 'Post_desc', true);
      if($Post_desc != '') echo $Post_desc ;
      ?>
      " title="<?php the_title(); ?>">Read this article " title="<?php the_title(); ?>">......

      <?php endwhile; ?>

    </div>
    </div>

    <div class="span-10 last"><?php include (TEMPLATEPATH . '/cats_sidebar.php'); ?></div>
    <div class="span-25">
    <?php include (TEMPLATEPATH . '/footer.php'); ?>
    </div>

    </div>
    </body>'

  2. Equal Web Creative
    Member
    Posted 1 year ago #

    Could it be this part:

    <?php $my_query = new WP_Query('showposts=2&offset=1'); ?>
    <?php while(have_posts()) : the_post();

    Shouldn't that be:

    <?php $my_query = new WP_Query('showposts=2&offset=1'); ?>
    <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
  3. amobaroti
    Member
    Posted 1 year ago #

    ^^^^ Thanks, but no that did not change a thing

  4. amobaroti
    Member
    Posted 1 year ago #

    Thanks!!! I managed to get it working. I think maybe my pagecaching widget did not allow me to see the changes straightaway

Topic Closed

This topic has been closed to new replies.

About this Topic