GetSimple Support Forum

Full Version: Hot to get theme url on plugin code?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello!
How I can get theme url adress on plugin code?

Something like get_theme_url(); effect on theme (I want to save this url on string, not for showing).

Please help Smile
yes that is exactly how you do it.

PHP Code:
/**
 * Get Theme URL
 *
 * This will return the current active theme's full URL 
 *
 * @since 1.0
 * @uses $SITEURL
 * @uses $TEMPLATE
 *
 * @param bool $echo Optional, default is true. False will 'return' value
 * @return string Echos or returns based on param $echo
 */
function get_theme_url($echo=true) {
    global 
$SITEURL$TEMPLATE;
    
$str trim($SITEURL getRelPath(GSTHEMESPATH) . $TEMPLATE);
    return 
echoReturn($str,$echo);    

Sorry, I am not a programer.
I want to do something like this:

$some = get_theme_url();
echo "My theme url is: " . $some . " ! ";

Now i get:
http://mysite.com/THEME... My theme url is: !

Thanks! Smile
most theme_functions output directly, that is what the echo = true argument is for

echo "My theme url is " . get_theme_url(false) . "!";

or

PHP Code:
$some get_theme_url(false);
echo 
"My theme url is: " $some " ! "

or just

Code:
My theme url is <?php get_theme_url(); ?> !
Hehe Smile
I did it wrong - get_theme_url($echo = false);

Thank you very much!