Display URL from Widget content inside href=””

Question

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:

$('.textwidget').contents().unwrap();

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

0
RS92 3 months 0 Answers 12 views 0

Leave an answer