php - Print a text from a widget located in a sidebar in Wordpress -



php - Print a text from a widget located in a sidebar in Wordpress -

i seek print text widget located in sidebar, when utilize code below, array looks following: array ([0] => text-2 [1] => text-3)

how can print text in text-2?

$siderbar = 'lank_i_header'; $the_sidebars = wp_get_sidebars_widgets(); print_r( $the_sidebars[$siderbar]);

i tried next code print "text-2"

print_r($the_sidebars[$siderbar][0] );

try

foreach ($the_sidebars[$siderbar] $sidebar_data){ echo $sidebar_data.'<br>'; }

php wordpress

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -