Nicholas Ritson
Nicholas Ritson

Reputation: 909

WordPress Widgets using PHP or Shortcodes

I created a header area thats basically 6 widgets, 3 on 2 rows. However, I would like to place into one of the widgets some PHP or a shortcode. The widget will only read HTML as far as I know. Is there a way perhaps in the functions.php to allow shortcodes or PHP to be read and executed as well?

Upvotes: 0

Views: 73

Answers (1)

silver
silver

Reputation: 5331

To enable shortcode on text widget, just add filter in your theme functions.php

add_filter( 'widget_text', 'do_shortcode' );

Upvotes: 1

Related Questions