crowdfavorite / wp-post-formats

An admin interface and structured post meta for WordPress post formats.
362 stars 78 forks source link

Updated cfpf_base_url() to work regardless of directory location #9

Closed wkirby closed 13 years ago

wkirby commented 13 years ago

Updated cfpf_base_url() to work regardless of directory location, allowing plugin to be used both as a WordPress plugin, but also as an include in a theme's functions.php file. Doing so allows theme developers to include the functionality without asking users to install a plugin.

Also fixes problem #8.

alexkingorg commented 13 years ago

The filter is already the way for a theme to set the path.

wkirby commented 13 years ago

Sorry. I'm a moron. I don't know where my brain was earlier.

ghost commented 12 years ago

hi! how to include in a theme's functions.php file?

ghost commented 12 years ago

i'm using this working code functions.php: // wp post formats require_once('library/wp-post-formats/cf-post-formats.php'); cf-post-formats.php: function cfpf_base_url() { /* return trailingslashit(apply_filters('cfpf_base_url', plugins_url('', FILE)));*/ return trailingslashit(apply_filters('cfpf_base_url', get_template_directory_uri() . '/library/wp-post-formats/')); }