I have a code like this (call a category defined from theme panel):
<?php query_posts ('ignore_sticky_posts=1&showposts=1&cat='.get_cat_id
($up_options->category1)
);
Everything work fine but need to add isset in case the category did not define.
I give isset like this:
<?php query_posts ('ignore_sticky_posts=1&showposts=1&cat='.get_cat_id(
(isset($up_options->category1) && $up_options->category1))
);
But did not work. Can anyone help me? I'm pretty new to PHP.
Thank for any kind of helps.
Here the full code:
<div class="wrapper">
<?php query_posts ('ignore_sticky_posts=1&showposts=1&cat='.get_cat_id($up_options->category1));
if (have_posts()) :
while (have_posts()) : the_post();?>
<div class="inside">
<div class="title">
<h5> <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php echo substr(the_title('', '', false), 0, 75); ?>...</a> </h5>
</div>
</div>
<?php endwhile; endif; wp_reset_query();?>
</div>