0

I am a little bit confused about how to change this span class="core" in the code below

<?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>'; 
}
?>

to this span class="<?= $styles['core']; ?>"

1 Answer 1

0

Just close PHP tag and write HTML codes:

<?php
if( !defined( 'CP_VC_ACTIVE' ) ){
   ?>
   <li>
      <span class="<?php echo $styles['core']; ?>"><?php echo esc_html__('Required','cpo')?></span>
      <a target="_blank" href="<?php echo esc_url(...); ?>"><?php echo esc_html__('hi I am here', 'cpo'); ?></a>
   </li>
   <?php
}
?>

But if you want to keep your code, this is how you can do it:

echo '<li><span class="' .$styles["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>'; 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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