permalinks all going to the same post
-
I’m having some issues with a site i’ve built : http://www.newsswipe.co.uk I have made the loop call the same category throughout the index.php offsetting the right number of posts as you can see. But the permalinks are all calling the same post. Below is the code for the index.php
can anyone explain this?
<?php get_header(); ?> <div id="block_featured" class="block"> <div class="block_inside"> <div class="text_block"> <div class="hellotext"><?php $posts = get_posts( "category=1&numberposts=1&order=DES" ); ?> <?php if( $posts ) : ?> <?php foreach( $posts as $post ) : setup_postdata( $post ); ?> <img class="imagespacer" <?php $szPostContent = $post->post_content; $szSearchPattern = '/src="(.*?)"/'; // Run preg_match_all to grab all the images and save the results in $aPics preg_match_all( $szSearchPattern, $szPostContent, $aPics ); // Check to see if we have at least 1 image $iNumberOfPics = count($aPics[0]); if ( $iNumberOfPics > 0 ) { // Now here you would do whatever you need to do with the images // For this example the images are just displayed for ( $i=0; $i < $iNumberOfPics ; $i++ ) { echo $aPics[0][$i]; }; }; ?> align="right" height=200 > <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <?php the_excerpt("Continue reading '" . the_title('', '', false) . "'"); ?> <div class="readmorefeatured"><a href="<?php the_permalink(); ?>">Read more...</a></div> <?php endforeach; ?> <?php endif; ?> </div> <br /> </div> </div> <div class="greybarmain"></div> <!-- right side --> <div id="minirant"><?php $posts = get_posts( "category=10&numberposts=1" ); ?> <?php if( $posts ) : ?> <?php foreach( $posts as $post ) : setup_postdata( $post ); ?> <h5>MiniRant</h5> <strong><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></strong> <?php the_content(); ?> <?php endforeach; ?> <?php endif; ?> <br /> <a href="rantarchive.php">Read more MiniRants</a> </div> <div id="cartoon"> </div> <!--end right side --> <div id="newslist"><div class="newslistnews"><?php $posts = get_posts( "category=1&numberposts=1&offset=1&order=DES" ); ?> <?php if( $posts ) : ?> <?php foreach( $posts as $post ) : setup_postdata( $post ); ?> <h5><a href="<?php the_permalink(); ?>" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h5> <?php the_excerpt(); ?> <div class="readmorefeatured"><a href="<?php the_permalink(); ?>">Read more...</a> <div class="greybarmainsmall"></div> <?php endforeach; ?> <?php endif; ?> </div> <div class="newslistnews"><?php $posts = get_posts( "category=1&offset=2&numberposts=3&order=DES" ); ?> <?php if( $posts ) : ?> <?php foreach( $posts as $post ) : setup_postdata( $post ); ?> <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3> <?php the_excerpt("Continue reading '" . the_title('', '', false) . "'"); ?> <div class="readmorefeatured"><a href="<?php the_permalink(); ?>">Read more...</a></div> <div class="greybarmainsmall"></div> <?php endforeach; ?> <?php endif; ?> </div> <div class="newslistnews"><?php $posts = get_posts( "category=1&offset=5&numberposts=1&order=DES" ); ?> <?php if( $posts ) : ?> <?php foreach( $posts as $post ) : setup_postdata( $post ); ?> <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3> <?php the_excerpt("Continue reading '" . the_title('', '', false) . "'"); ?> <div class="readmorefeatured"><a href="<?php the_permalink(); ?>">Read more...</a></div> <?php endforeach; ?> <?php endif; ?></div> <br /> <div class="browsearchives"><a href="archives.php">Browse our Archives</a></div> </div> </div> <div class="greybarbottom"></div> </div> <?php get_footer(); ?>Thanks in advance π
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
The topic ‘permalinks all going to the same post’ is closed to new replies.