WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 2 years ago

#19267 closed feature request (duplicate)

Add a theme_url() function.

Reported by: filipekiss Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Themes Keywords:
Focuses: Cc:

Description

Wordpress already has a function for returning the plugin URL based on the file you are calling it http://codex.wordpress.org/Function_Reference/plugins_url, so I was thinking we could really use some theme_url() like function. It would be simpler than calling the option 'template_url' every time we wanted to include a file.

So we would just call <img src="<?php theme_url('images/my-image.jpg');?>" /> instead of <img src="<?php bloginfo('template_url');?>/images/my-image.jpg" />;

This is my first ticket, so I'm not sure if I chose the right component

Change History (4)

comment:2 in reply to: ↑ 1 filipekiss2 years ago

Replying to linuxologos:

#19200

It's not actually the same function. He's asking just for a function to return the themes folder url. I want one to retrieve the current theme url and append the wanted file/image/whatever path to it. I stumbled upon that request before posting; :)

comment:3 johnbillion2 years ago

Related: #18302, with which you could use locate_template_uri() instead of two separate *_url() functions for the template directory and the stylesheet directory.

comment:4 scribu2 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

This is basically the same thing as #18302, only without inheritance support.

Closing.

Note: See TracTickets for help on using tickets.