PHP Shortcode string

I have a short code to a Wordpress plugin I am using, but I want to add it to a page temple. That part is fine but I’m trying to wrap the short code around the_post_thumbnail and the_excerpt of post. The short code works when I don’t include the functions I have created. Any help would be very welcome!

<?php $teamMember = new WP_Query('category_name=team&showposts=-1'); ?>
        <?php while ($teamMember->have_posts()) : $teamMember->the_post();?>

<?php get_template_part( 'content', 'page' ); ?>
<?php function profileThumb() { echo the_post_thumbnail(); } ?> <?php function profileExcerpt() { echo the_post_thumbnail(); } ?> <?php echo do_shortcode("[simple_tooltip content=' . profileExcerpt(); .' ]' . ' profileThumb();' . ' [/simple_tooltip]"); ?>
<?php endwhile ?> 

    <?php wp_reset_query(); ?>

Well, not sure if I can help, but…

The two functions that you wrote in PHP do nothing. They echo some sort of defined PHP variable, not any
data or text. So, “echo the_post_thumbnail()” in the first function does nothing really. It is not text, so it
will not display that, it is not a variable so no data is displayed. To explain further…

In PHP you store your data inside of variables. You load the values of the variables from either your PHP
code calculations, from a database or from user inputs. You then use the echo command to display them.

So, if you say some text that sets up an url link to a page. But, to put the
page name in using PHP, you would have to use something like this:

<?PHP $the_permalink="somepage.com"; ?>

<a href=’<?PHP echo $the_permalink; ?>’ some text
As you see, the PHP echo’s a variable previously loaded up. In all of your echo’s, you have no variables
printed, just text. But, the text did not have quotes or double-quotes around them, so they would not
even be displayed.

Hope that helps!

Sponsor our Newsletter | Privacy Policy | Terms of Service