As they return content you may just be able to return a conditional true if they have a value.
<?php if(function_exists('the_powerpress_content') ) : ?>
<?php if(the_powerpress_content() ) : ?>
<div class="powerPress">
<?php the_powerpress_content(); ?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php if(function_exists('sf_blog_linked_tag') ) : ?>
<?php if( sf_blog_linked_tag($post->ID, true) ) : ?>
<div class="sfLink">
<?php sf_blog_linked_tag($post->ID, true); ?>
</div>
<?php endif; ?>
<?php endif; ?>
Note: closing semi-colon’s added!
HTH
David
Oh, thanks for the semis, totally missed that! I’ll have to try what you’ve got tomorrow, thanks!
I had messed with if( !empty($post->function) )
in various manners with no success (nothing showed up at all) so I’ll play around tomorrow and report!
Hmmm, well, I don’t believe the conditional is working? Or something is off here…. The actual link and player called by those functions works, but the div class we are adding in doesn’t print out at all
What about trying is_plugin_active()? Failing that, you might just be targeting the wrong functions from the plugins within your conditionals.
[NB: Still looking at that breadcrumb plugin]
well, the plugin will always be active. I just only want those div classes output on the posts that contain those player/link items.
And thanks again for looking into the breadcrub thing…..
Do both of these plugins just echo content or is there a way you could feed that content into a variable?
Yup…. I’m outta my league here…..
add_filter('get_the_excerpt', 'powerpress_content', (POWERPRESS_CONTENT_ACTION_PRIORITY - 1) );
add_filter('the_content', 'powerpress_content', POWERPRESS_CONTENT_ACTION_PRIORITY);
add_filter('the_excerpt', 'powerpress_content', POWERPRESS_CONTENT_ACTION_PRIORITY);
I’m assuming adds the player onto the content as appropriate…
function the_powerpress_content()
{
echo get_the_powerpress_content();
}
I’m gonna have to look at get_the_powerpress_content….
Or…. I may just be trying to much….. Maybe I should just live with the gaps in my theme until I learn code better eh!
It looks like get_the_powerpress_content();
could be used to drop the plugin’s output in a variable.
<?php $my_powerpress_content = get_the_powerpress_content();
if( isset( $my_powerpress_content) ) :?>
<div class="powerPress">
<?php the_powerpress_content(); ?>
</div>
<?php endif; ?>
<?php endif; ?>
yup…. I had actually just done:
<?php if(function_exists('the_powerpress_content') ) : ?>
<?php if(get_the_powerpress_content() ) : ?>
<div class="powerPress">
<?php the_powerpress_content(); ?>
</div>
<?php endif; ?>
<?php endif; ?>
which seems to work. I’m gonna test a bit more and if that’s not it try your code. Thanks very much. I’m gonna dig into the other plugin now and see what happens.
Much appreciated!
Well, I absolutely can’t see anyone else ever being in this situation! lol…. but because I like closure, this appears to work for me!
<?php if(function_exists('the_powerpress_content') ) : ?>
<?php if(get_the_powerpress_content() ) : ?>
<div class="powerPress">
<?php the_powerpress_content(); ?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php if(function_exists('sf_blog_linked_tag') ) : ?>
<?php $thisLink = sf_blog_links_control('read', $post->ID);
if(isset( $thisLink ) ) : ?>
<div class="sfLink">
<?php sf_blog_linked_tag($post->ID, true); ?>
</div>
<?php endif; ?>
<?php endif; ?>