Offset not working in category page
-
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: https://www.olorimag.com/category/absolutely-loving-this/
‘<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “https://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
<html xmlns=”https://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>-
<?php $my_query = new WP_Query(‘showposts=1’); ?>
<?php while ($my_query->have_posts()) : $my_query->the_post(); ?><div class=”postdesc”>
<h5>“><?php the_title(); ?></h5>
<p><?php
$Post_desc = get_post_meta($post->ID, ‘Post_des’, true);
if($Post_desc != ”) echo $Post_desc ;
?>
</p>
” title=”<?php the_title(); ?>”>Read this article ” title=”<?php the_title(); ?>”>……
</div><?php endwhile; ?>
</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>’
- The topic ‘Offset not working in category page’ is closed to new replies.