Display URL from Widget title inside href=””


I’m creating list of social networks. I displayed on front-end and styled in code.

Now I want to have option in Widgets to change URLs for each socia network.

I created sidebar:

register_sidebar( array(
  'name'          => 'Twitter URL',
  'id'            => 'twitter-url',
  'before_widget' => '',
  'after_widget'  => ''
) );

Inside that sidebar I put Custom HTML Widget and in content text area I put link.

 <a href="<?php echo dynamic_sidebar('twitter-url');?>"> TWITTER </a>

But inside href, I got this <div class="textwidget custom-html-widget"></div>

I tried to fix with jQuery:


But this div still appearing, it’s appear only in href, if I call sidebar on another place that wont be displayed.

So how to call link from this sidebar / widget

RS92 2 months 0 Answers 10 views 0

Leave an answer