get_theme_root_uri [ WordPress Function ]
get_theme_root_uri ( $stylesheet_or_template = false, $theme_root = false )
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Soorgelijke functies: get_theme_root, get_theme_roots, get_raw_theme_root, get_stylesheet_uri, get_theme_mod
Retrieve URI for themes directory.
Does not have trailing slash.
Source
<?php
function get_theme_root_uri( $stylesheet_or_template = false, $theme_root = false ) {
global $wp_theme_directories;
if ( $stylesheet_or_template && ! $theme_root )
$theme_root = get_raw_theme_root( $stylesheet_or_template );
if ( $stylesheet_or_template && $theme_root ) {
if ( in_array( $theme_root, (array) $wp_theme_directories ) ) {
// Absolute path. Make an educated guess. YMMV -- but note the filter below.
if ( 0 === strpos( $theme_root, WP_CONTENT_DIR ) )
$theme_root_uri = content_url( str_replace( WP_CONTENT_DIR, '', $theme_root ) );
elseif ( 0 === strpos( $theme_root, ABSPATH ) )
$theme_root_uri = site_url( str_replace( ABSPATH, '', $theme_root ) );
elseif ( 0 === strpos( $theme_root, WP_PLUGIN_DIR ) || 0 === strpos( $theme_root, WPMU_PLUGIN_DIR ) )
$theme_root_uri = plugins_url( basename( $theme_root ), $theme_root );
else
$theme_root_uri = $theme_root;
} else {
$theme_root_uri = content_url( $theme_root );
}
} else {
$theme_root_uri = content_url( 'themes' );
}
return apply_filters( 'theme_root_uri', $theme_root_uri, get_option('siteurl'), $stylesheet_or_template );
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- Function Reference/get theme root uri « WordPress Codex
Description. Retrieve URI for themes directory. Does not have trailing slash. Usage. <?php get_theme_root_uri(); ?> Parameters. None. Return Values ...
codex.wordpress.org - WordPress › Support » get_theme_root_uri() returns different siteurl
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" /> <link rel="pingback" href="<?php bloginfo('pingback_url'); ?> ...
wordpress.org - get_theme_root_uri (WordPress Function) - WPSeek.com
WordPress lookup for get_theme_root_uri, a WordPress Function. wpseek.com is a WordPress-centric search tool for developers and theme authors.
wpseek.com - get_theme_root_uri | A HitchHackers guide through WordPress
Feb 12, 2011 ... Source code. function get_theme_root_uri( $stylesheet_or_template = false ) { if ( $stylesheet_or_template ) { if ( $theme_root ...
hitchhackerguide.com