0

How I can add a link to the slogan here?

<li class="sadguy"><?php echo esc_attr($top_bar_slogan); ?></li>

I have read other questions but I really didn't understand, can someone help me please?

I saw other answers that says I can use something like this:

<?php echo “<a href='http://www.example.com’>Click here</a>” ; ?>

But in my code it's variable not text "esc_attr($top_bar_slogan)" Should I use it like this or it's wrong?

<li class="sadguy"><?php echo “<a href='http://www.example.com’> esc_attr($top_bar_slogan)</a>; ?></li>
N m
  • 3
  • 4
  • Please edit the question to say what you have tried, and show the broken output. – Ruan Mendes Jul 01 '20 at 16:25
  • You can also just do `$slogan = esc_attr($top_bar_slogan); echo " – Ruan Mendes Jul 01 '20 at 16:37
  • Or even better: `
  • – Ruan Mendes Jul 01 '20 at 16:39