Reputation: 35
How to get the current page title and show on text widget sidebar in wordpress?
can anyone help would be appreciated?
Thanks
Upvotes: 1
Views: 5922
Reputation: 352
Using a text / code widget (that allows you to enter code, not a standard text box)
<?php
$here = wp_title();
echo $here ; ?>
Upvotes: 0
Reputation: 1978
You could for example use the "PHP Code widget": http://wordpress.org/extend/plugins/php-code-widget/
And then paste something like the following in the configuration section of the widget:
<?php echo get_the_title($ID); ?>
Upvotes: 4