How to check if a function has content before outputting divs?
-
Is there any way to check if these are empty? This whole php thing is pretty unfamiliar to me, so I’m going to keep searching…..but just in case someone can help me. I’ve got this powerpress player, and simple forum link. The classes here take up space in my layout, so I only wanted them output if there is actual content. I’m guessing that the problem here is that I’m just checking if the function exists, not if it contains anything….. is that right? Any ideas?
<?php if(function_exists('the_powerpress_content') ) : ?> <div class="powerPress"> <?php the_powerpress_content() ?> </div> <?php endif; ?> <?php if(function_exists('sf_blog_linked_tag') ) : ?> <div class="sfLink"> <?php sf_blog_linked_tag($post->ID, true) ?> </div> <?php endif; ?>
Or is it not that simple? Do I need to check something else within the plugin for content or something?
Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
- The topic ‘How to check if a function has content before outputting divs?’ is closed to new replies.