WordPress.org

Ready to get started?Download WordPress

Forums

using bloginfo(template_directory) inside php?? (3 posts)

  1. sepp88
    Member
    Posted 4 years ago #

    hey guys,
    i wonder what I'm getting wrong here, but somehow i'm not able to save the path of my blogs template_directory to a variable in php.

    if i set:
    $url = bloginfo('template_directory') ;
    $url gets printed out even though i'm not using any print or echo statement. how can i easily save the path of my current blog's template_directory to a variable in php?

    regards matt

  2. popper
    Member
    Posted 4 years ago #

    Hey there,

    bloginfo always prints out the information. To store it in a variable use get_bloginfo() instead. See: http://codex.wordpress.org/Function_Reference/bloginfo

  3. sepp88
    Member
    Posted 4 years ago #

    thank you!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.