crazyflx
Elite Member
- Nov 9, 2009
- 1,623
- 4,870
change
if ($screen != "")
to
if (isset($screen) && $screen != false && !empty(trim($screen)) && $screen != NULL && $screen != "")
No dice...that just made the sidebar disappear altogether.
change
if ($screen != "")
to
if (isset($screen) && $screen != false && !empty(trim($screen)) && $screen != NULL && $screen != "")
This should work
If it did, PM me for paypal email.I could use the extra bucks.
Nope, now nothing appears in that block...
<div id="postlist">
<ul class="spy">
<?php $my_query = new WP_Query('orderby=rand'); ?>
<?php while ($my_query->have_posts()) : $my_query->the_post();?>
<?php $screen = get_post_meta($post->ID, 'screen', $single = true);
if (strlen(trim($screen)) > 1)
{?>
<li>
<img src="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=<?php echo $screen; ?>&h=60&w=100&zc=1" alt=""/>
<h2><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
<div class="fcats"><?php the_category(', '); ?> </div>
<div class="auth"> Posted by <?php the_author(); ?> </div>
</li>
<?php
}
?>
<?php endwhile; ?>
</ul>
</div>
<div class="clear"></div>
<div id="postlist">
<ul class="spy">
<?php $my_query = new WP_Query('orderby=rand'); ?>
<?php while ($my_query->have_posts()) : $my_query->the_post();?>
<?php if(strlen($screen = get_post_meta($post->ID, 'screen', $single = true)) > 5) { ?>
<li>
<img src="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=<?php echo $screen; ?>&h=60&w=100&zc=1" alt=""/>
<h2><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
<div class="fcats"><?php the_category(', '); ?> </div>
<div class="auth"> Posted by <?php the_author(); ?> </div>
</li>
<?php } ?>
<?php endwhile; ?>
</ul>
</div>
<div class="clear"></div>
@Born2Hack -> Not sure if you're closer to a solution or further away.
Your previous two posts made it so that NOTHING appeared there. This most recent one, the horizontal bars that normally have the post info in them, actually appear (and move like they are supposed to). However, there is nothing in them...they are completely blank.
If a post that had an image associated with "screen" appears in it though, everything looks normal (but only for that one, the other bars are still blank).
I edited the code in the above post. I misplaced a tag. Try it again.
<div id="postlist">
<ul class="spy">
<?php $my_query = new WP_Query('orderby=rand'); ?>
<?php while ($my_query->have_posts()) : $my_query->the_post();?>
<?php $screen = get_post_meta($post->ID, 'screen', $single = true);
if(preg_match("/http/",$screen))
{?>
<li>
<img src="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=<?php echo $screen; ?>&h=60&w=100&zc=1" alt=""/>
<h2><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
<div class="fcats"><?php the_category(', '); ?> </div>
<div class="auth"> Posted by <?php the_author(); ?> </div>
</li>
<?php
}
?>
<?php endwhile; ?>
</ul>
</div>
<div class="clear"></div>
Born2Hack has gotten this taken care of for me, looks awesome! Thanks again! Money sent.
echo "<div class="bhw_test">";
needs to be
echo "<div class=\"bhw_test\">";
Need to escape the " so it doesn't end the string prematurely.
You can also do ?> <div class="bhw_test"> <?php to bounce from php to html