Enable Shortcode in WordPress’ Widgets and Comments

Posted in: Programming @en,Web Design |

This post is also available in: Indonesian

shortcode

This post is also available in: Indonesian

Sometimes we need to use shortcodes in the widgets or comments. One example of using shortcode in the Widget is to create a different style to specific word in the Widget Title, by putting the word in the span tag. This span then later given a different style via CSS. Example is below.

Shortcode di Widget

To enable shortcode in Widgets, add lines below in file function.php inside your theme folder.

add_filter('widget_title', 'do_shortcode');
add_filter('widget_text', 'do_shortcode');

Shortcode di Comment

While to enable in comments, add line below.

add_filter('comment_text', 'do_shortcode');



Comments

There is one comment


  1. DSLR-A850 says:

    Banyak terima kasih untuk mengembangkan usaha untuk membahas ini , saya merasa kuat tentang hal ini dan seperti mempelajari lebih banyak mengenai hal ini . Jika layak , karena Anda mendapatkan keahlian , maukah kau memperbarui halaman Web Anda memiliki banyak jauh lebih info? Hal ini sangat bermanfaat bagi saya .



Speak Up!

Leave your own comment

Notify me of follow-up comments via e-mail (or subscribe here).




 

Share

Subscribe Feed

Email

Facebook

Twitter

Delicious

Digg

StumbleUpon

Google Buzz

Deviantart