1

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!

1 Answer 1

1

Do you mean something like:

return '<img class="myimage '.$text_color.' '.$horizontal.$slide_fitscreen.'" src="'.$image.'" alt="" '.$slide_desc.' />'.do_shortcode('[gallery]');
Sign up to request clarification or add additional context in comments.

1 Comment

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.