0

I am a little bit confused about the following code:

i need to add span class="<?= $styles['core']; ?>"

<?php 
if( ! defined( 'CP_VC_ACTIVE' ) ) {
echo '<li><span class="core">'.esc_html__('Required','cpo').'</span><a target="_blank" href="'. esc_url( admin_url( 'themes.php?page=tgmpa-install-plugins' ) ) . '"> '. esc_html__('hi iam here', 'cpo') . '</a></li>'; 
}
?>
2
  • Is it the single and double quotes that's confusing you? <span class="'.$styles['core'].'"> should work or try defining what you want to add as a variable: $addthis = $styles['core'];. Then add the variable like so: <span class="'.$addthis.'">. Mar 26 at 16:22
  • it doesn't work , i have fixed it by closing PHP tag and write HTML codes Mar 26 at 16:37

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.