WordPress.org

Ready to get started?Download WordPress

Forums

If Statement and Custom Checkbox (2 posts)

  1. jayo
    Member
    Posted 5 years ago #

    Hey guy, hate to be bothersome with this, but I cannot find the answer or solution to my problem for the life of me....

    Basically, I have created a custom field checkbox on my write page. I have a custom theme, and wanna add a select number of posts into my sidebar IF the checkbox is ticked.

    IM using this current code to call in these posts from a category named "Must Read", but Id like to include them using the checkbox instead of having the extra category.

    <?php /* edit showposts to alter number of posts shown in 'features' section */ query_posts('cat=4&showposts=3'); if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    <div class="mustread"><a href="<?php the_permalink(); ?>"><?php the_title();?></a>
    <?php the_excerpt(); ?></div>
    
    <div class="thumb">
    <?php $image=get_post_meta($post->ID,"imgsmall",true); if ($image) { ?>
    <a href="<?php the_permalink();?>"><img src="<?php echo $image; ?>" border="0" alt="<?php the_title();?>" width="125" /></a>
    <?php } ?>
    
    <?php endwhile; ?>

    Can anyone offer some help?

  2. jayo
    Member
    Posted 5 years ago #

    anyone?

Topic Closed

This topic has been closed to new replies.

About this Topic