...
  • Home
  • Shell
    • Emacs
    • Perl
    • screen
    • sed
  • Ubuntu
    • VNC
  • Web Development
    • Javascript
    • Joomla
    • MySQL
    • osTicket
  • Windows
    • Gimp
KEEP IN TOUCH

Most Popular

  • osTickets > Reports v4.1 (11805)
  • HTPC > Setup Windows 7 as a Media Center with XBMC (6368)
  • osTicket > Auto-Assignment Rules (3602)
  • osTicket > View headers for original email message (2331)
  • Ubuntu 10.10 VNC Login Screen (2161)

Posts tagged wordpress

WebDev > Allow PHP in WordPress Widgets

Jan26
2012
Leave a Comment Written by Scott Rowley

The following will allow for you to post PHP in your widgets:

Place in your functions.php file
Appearance > Editor > Theme Functions (functions.php)

add_filter('widget_text', 'php_text', 99);

function php_text($text) {
 if (strpos($text, '<' . '?') !== false) {
 ob_start();
 eval('?' . '>' . $text);
 $text = ob_get_contents();
 ob_end_clean();
 }
 return $text;
}

Now you can place php code so long as its within its <?php and ?> tags.
Credit

ajax loader
Posted in Web Development - Tagged allow, functions, php, theme, widget
SHARE THIS Twitter Facebook Delicious StumbleUpon E-mail

Be Heard!

Authors needed! Feel like sharing your tech wisdom with the world? We are looking to expand our writer base and would love to hear from you. We need articles on any relevant technology/software/media/howto/etc (Well...lets at least hold to the legal stuff ;)

Just email scott (at) sudobash (dot) net

Corrections? Questions? Comments?

Find an error?
Everything work out great for you?
Have some feedback?
Like to see something added to the article?

PLEASE leave us a comment after the article and let us know how we are doing, or if something needs corrected, improved or clarified.

Thank you!
- The Management

Sudo Bash Member sites

Des Moines, Iowa Karate Classes
Iowa MMA Tournaments
Iowa SAR

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org

RSS HowToGeek

  • DIY Digital POV Clock On a Hard Drive Platter
  • How to Disable the Splash Screens in Office (Word, Excel, PowerPoint)
  • How To Resolve Dependencies While Compiling Software on Ubuntu
  • Version Tracking With Subversion (SVN) For Beginners
  • How to Set Up Email Notifications for Your Windows Home Server

RSS TheGeekStuff

  • How to Install GIT for Windows and Create / Clone Remote Repositories
  • 5 Practical Linux fuser Command Examples
  • Linux Memory Management – Virtual Memory and Demand Paging
  • XSS Attack Examples (Cross-Site Scripting Attacks)
  • 10 Things You (and Your Boss) Can Do To Change Your World

RSS LifeHacker

  • Remove Clothing Wrinkles with a Damp Towel [Clothes]
  • Factor in the Convenience Fee Before Charging Income Taxes to Your Credit Card [Taxes]
  • How to Block Annoying Tech Rumors and Movie Spoilers on Your Browser [Annoyances]
  • Use Plastic Shower Caps in the Kitchen to Cover Large Bowls and Leftovers [Clever Uses]
  • Twitter for iOS and Android Updates, Restores Swipe Gestures and Optimizes for Android Tablets [Updates]

EvoLve theme by Blogatize  •  Powered by WordPress Sudo Bash
By Geeks - For Geeks

Back to Top