I have this part of code:

return '<img class="myimage '.$text_color.' '.$horizontal.$slide_fitscreen.'" src="'.$image.'" alt="" '.$slide_desc.' />';

What I want to do is to return also a php shortcode but not inside the <img>, because my shortcode generates a <a> element so I need to return it after the img

this is my shortcode:

<?php echo do_shortcode('[gallery]'); ?>

How can I make this ?

Thanks!

share|improve this question

feedback

1 Answer

up vote 1 down vote accepted

Do you mean something like:

return '<img class="myimage '.$text_color.' '.$horizontal.$slide_fitscreen.'" src="'.$image.'" alt="" '.$slide_desc.' />'.do_shortcode('[gallery]');
share|improve this answer
Not really working for me. I receive something like this: Error (Parseerror): Syntax Error Unexpected Token < but I guess is from my website not from your code – Alecs Aug 27 at 14:02
feedback

Your Answer

 
or
required, but never shown
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.