Posts not displaying anything
-
I have checked all the various bits of the code I can think of and for some reason or another my posts aren’t displaying when they are clicked.. they are just blank… see with my link below:
any ideas as to why this is happening?
Thanks in advance
Chris
-
I’m guessing you fixed this? Posts look like they’re displaying fine now. Few 404’s, but that might be plugin related?
Not really fixed.. now back to a previous error.. which means that the first post always displays.. Its not a plug in issue 🙁 as it does the same when I disable all plugins.. It must be something to do with the code i’m using to call the post.. I just don’t know.
<?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(); ?>bump!
bump! please help me with this.. its driving me crazy!
The topic ‘Posts not displaying anything’ is closed to new replies.