wordpress - Mixing php with html tags -


this question has answer here:

i trying implement below code, result displayed nothing back.

 <li class="cleanup">garantie:<span><?php (get_post_meta(get_the_id(), 'garantie', true); ?> jahre</span><?php echo (get_post_meta(get_the_id(), 'garantie', true) >= 2) ? ('<span class="pro_con pro"><i class="fa fa-check"></i>lange garantie: ' . <?php (get_post_meta(get_the_id(), 'garantie', true)); ?> . ' jahre</span>') : ('<span class="pro_con pro"><i class="fa fa-check"></i>standart garantie: ' . <?php (get_post_meta(get_the_id(), 'garantie', true)); ?> . ' jahre</span>'; ?>) </li> 

the field should available , function get_post_meta work!

i assume have syntax error, not sure where?

any suggestions doing wrong?

i appreciate replies!

you have parenthesis, change to

<?php get_post_meta(get_the_id(), 'garantie', true); ?> //   ^ here 

and way, must have logging on on devel env, logs lot.


Comments