• Hey, I’m sure this is pretty simple, but I’ve been trying and searching for over an hour night and I can’t seem to figure it out.

    I’m using a gallery plugin which links to a gallery stylesheet, as I am using multiple templates I have put different gallery stylesheets within the different theme folders. I am trying to change the style link so that it points to the corresponding stylesheet. This is what it currently looks like:

    echo "<link rel='stylesheet' href='" . $plugin_url .
        "/lazyest-style.css' type='text/css' media='screen' />\n";

    It currently takes the plugin url and looks for lazyest-style.css within it. I want to change this so that it takes the template url. I’m sure this can be done by changing the $plugin_url to something that references the template url. What tag can I use to reffer to the template?

    Any help is much appreciated,
    Thanks,
    Chris

Viewing 4 replies - 1 through 4 (of 4 total)
  • <?php bloginfo('template_directory'); ?>

    Thread Starter drinkingsouls

    (@drinkingsouls)

    Hey,
    thanks for the reply, I should have mentioned that I did try that but I lack the knowledge to utilize it. Here is the stylesheet function:

    function lg_add_lazyest_gallery_style()
    {
      global $plugin_url;
      echo "<!-- lazyest gallery " . LG_VERSION . " stylesheet  -->\n";
      echo "<link rel='stylesheet' href='" . $plugin_url .
        "/lazyest-style.css' type='text/css' media='screen' />\n";
      echo "<!-- lazyest gallery style end -->\n";
    }

    It’s currently calling the stylesheet lazyest-style.css in the plugin directory, this needs to be changed to the template directory. I have tried putting <?php bloginfo(‘template_directory’); ?> where $plugin_url is but this doesn’t work. I lack the knowledge to know how to structure php.
    Can anyone tell me where to place the template tag?
    Thanks

    The code is look right, it should link to css if css file is really existed.

    Why don’t you try putting <?php bloginfo(‘tempalte_url’); ?> somewhere in HTML under body section to see if the output is exactly what you expect.

    Or try:

    echo "<link rel='stylesheet' href='" . get_bloginfo('template_directory') .
        "/lazyest-style.css' type='text/css' media='screen' />\n";
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Get Template Directory’ is closed to new replies.