php - Syntax for using echo inside an echo (wordpress slider) -



php - Syntax for using echo inside an echo (wordpress slider) -

this piece of code i'm not sure how deal with:

<?php echo get_post_meta($post->id, 'smartslider2', true); ?> <?php echo do_shortcode('[smartslider2 slider="inserthere"]'); ?>

i want insert first echo instead of inserthere. first echo should output content of custom field. sec should recall slider specific number inserted in custom field. when trying different possibilities errors.

can help?

thank :)

don't echo first value, utilize straight within sec echo.

<?php echo do_shortcode('[smartslider2 slider="'.get_post_meta($post->id, 'smartslider2', true).'"]'); ?>

or can set first value in variable , utilize variable in sec line

<?php $slider = get_post_meta($post->id, 'smartslider2', true); ?> <?php echo do_shortcode('[smartslider2 slider="'.$slider.'"]'); ?>

php wordpress slider echo

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -