WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Creating a plugin: how to get the current template path (3 posts)

  1. Elan42.com
    Member
    Posted 6 years ago #

    Hi... I'm editing a plugin and I need the path of the template that the user is using.

    How do I use the get_bloginfo() function inside a plugin php file?

  2. Elan42.com
    Member
    Posted 6 years ago #

    The problem is that using, inside a plugin, the code:
    $MYVAR=bloginfo('template_url') . 'img/'

    I don't have the template_url in the MYVAR variable...
    Instead I have the template_url putted before the "header" of the blog, like a php error.

    That's probably because calling the bloginfo function makes it go inside the output stream of php, like an ECHO, but I don't want this.
    How to resolve the problem?

  3. Elan42.com
    Member
    Posted 6 years ago #

    Using:
    get_bloginfo

    resolved the problem

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.