Feature page not showing up

There’s supposed to be a feature/headlines page displaying but I think there’s something wrong with the code which is preventing it from showing properly…

Any ideas? It doesn’t show up at all (the “headlines” portion)

<?php $wp_query->is_home = true;  $wp_query->is_page = false; ?>

<?php get_header(); ?>

					<?php if ($GLOBALS['ex_welcome']) : ?>
					<div class="headlines">
							$posts = get_posts( "page_id=" . $GLOBALS['ex_welcome'] ); 
							if( $posts ) :
								foreach( $posts as $post ) : setup_postdata( $post );
						<div class="headline">
							<h2><?php the_title(); ?></h2>
							<?php if ( get_post_meta($post->ID, "excerpt", $single = true) <> "" ) { echo '<p>' . stripslashes( get_post_meta($post->ID, "excerpt", $single = true) ) . '</p>'; } else { the_content(); } ?>
							<a href="<?php echo get_permalink(  $page->ID ); ?>" class="learn-more">Learn More</a>
					</div><!-- End headlines -->
					<?php if ( get_post_meta( $post->ID, "image", true ) <> "" ) { ?>
					<div class="latest-image">
						<img src="<?php bloginfo( 'template_directory' ); ?>/thumb.php?src=<?php echo get_post_meta( $post->ID, "image", true ); ?>&amp;w=444&amp;h=255&amp;zc=1" alt="<?php the_title(); ?>" />
						<?php if ( get_post_meta( $post->ID, "image_caption", true ) <> "" ) { ?>
						<p class="image-caption">
							<?php echo get_post_meta( $post->ID, "image_caption", true ); ?>
						<?php } ?>
					</div><!-- End latest-image -->
					<?php } ?>
				</div><!-- End clearfix -->
			</div><!-- End container -->
			<div id="news-top"></div><!-- End news-top -->
			<?php include_once( TEMPLATEPATH . '/includes/news.php' ); ?>
			<?php include_once( TEMPLATEPATH . '/includes/featured_tabs.php' ); ?>
<?php get_footer(); ?>

Thanks so much

First thing would be to check if $GLOBALS[‘ex_welcome’] is actually set or not, if its not being set then the code wont execute.

Sorry, I’m not too familiar with PHP, how would I check to see if it’s set?


you could just echo the value out into the page to see what it contains. make sure you put it in between the <?php opening tag and the if statement

so replace

<?php if ($GLOBALS['ex_welcome']) : ?>
                    <div class="headlines">


echo '************ ' . $GLOBALS['ex_welcome'] . ' ************';
if ($GLOBALS['ex_welcome']) : ?>
                    <div class="headlines">

somewhere on your page will be the text

************ value *************

okay, so the page shows:

************ 2 ************

what does this mean?

Sorry, it’s like trying to teach algebra to a goose.

hey, some of my geese do calculus, so dont worry :smiley:

It shows us that your global variable is being set, so now we know where the problem is. :wink:

let me go through the code here and see if anything else jumps out

Does removing the “page_id=” string from your concatenated parm help?

I would change the first line to:


How is thaqt variable being set?

sorry, I literally don’t know anything about PHP… (e.g: don’t know how to set variables etc…).

I have lots of questions about the script, you call many functions of which we know nothing about etc.

But if you dont know your **** for your elbow in PHP you wont be able to get the answers for us. That only leaves you to post all of your code and hope somebody has the time to sit and go through it all to find your problem.

Sorry I dont have that much time free !!

Ya sorry. Like I said, I know nothing about it so I wasn’t sure if it was a quick fix or if that snippet was enough to solve the problem.

I’ll read a few books and come back…

What theme and what parts of the code are you using?