Feeds

WordPress function to check which theme is being used?

PerformancingAds
Submitted by Ryan Caldwell on June 14, 2007 - 8:40pm in

Is there a WordPress function that will return the theme that's currently being used?

I'm sorta desperate here;-) Maybe you can figure out why by playing around themes.performancing.com


Sweet. I figured it

Sweet. I figured it out.

First, I downloaded the Exec-PHP plugin. Second, I included the following code inside of a WordPress post:

<?php
if (ts_get_theme()=="Photopress"){
?>

<?php
}
?>

Replace the square brackets with angled brackets.

Can anyone guess why I had needed this at http://themes.performancing.com

Ten dollars to the first

Ten dollars to the first person who can figure out why I needed this theme based logic.

Hark

Hark - a new theme cometh!

Oops

so let me be more specific. You appear to have some theme specific content in that announcement post.

you want

It's cause you're building a theme switcher?

Raj, nope. But think about

Raj, nope. But think about why I might want to display content in one theme but not another;-) Go to themes.performancing.com and browse through the themes. Pay special attention to anything that changes.

okay

Okay, it is part of the theme switcher, but I noticed you're showing two images in Photopress but one in the others, and different sizes.

I think HandySolo wins the

I think HandySolo wins the prize, though Raj later got it exactly. $10 to both of you. PM me your paypal addresses and I'll send the money.

"You appear to have some theme specific content in that announcement post."

Yep, Photopress can handle 640px wide images and the other themes can't.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <h2> <h3> <h4> <img> <div> <a> <em> <strong> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <span> <table> <td> <tr> <caption> <th> <hr> <pre> <br> <p> <object> <param> <embed> <strike>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
3 + 5 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.