1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
//テーマのURLを取得する echo get_template_directory_uri();// /www/accelboon.com/tn/wp/wp-content/themes/tn //style.cssのURLを取得する。get_template_directory_uriと同じだが、小テーマの場合は小テーマのURL echo get_stylesheet_directory_uri();// https://accelboon.com/tn/wp/wp-content/themes/tn //style.cssのURLをファイル名込で取得する echo get_stylesheet_uri();// https://accelboon.com/tn/wp/wp-content/themes/tn/style.css //テーマのディレクトリを取得する echo get_template_directory();// /www/accelboon.com/tn/wp/wp-content/themes //style.cssのディレクトリを取得する echo get_stylesheet_directory();// /www/accelboon.com/tn/wp/wp-content/themes/tn //テーマディレクトリを取得する echo get_theme_root();// /www/accelboon.com/tn/wp/wp-content/themes //一般→サイトアドレス で設定したURL echo home_url();// https://accelboon.com/tn //一般→wordpressアドレス で設定したURL echo site_url();// https://accelboon.com/tn/wp //wp-adminのURL echo admin_url();// https://accelboon.com/tn/wp/wp-admin/ //includesディレクトリのURLの取得 echo includes_url();// https://accelboon.com/tn/wp/wp-includes/ //contentディレクトリのURLの取得 echo content_url();// https://accelboon.com/tn/wp/wp-content //pluginsディレクトリのURLの取得 echo plugins_url();// https://accelboon.com/tn/wp/wp-content/plugins //アップロードディレクトリの情報を配列で取得 $wp_upload_dir = wp_upload_dir(); echo $wp_upload_dir['path'];// /www/accelboon.com/tn/wp-content/uploads/2015/10 echo $wp_upload_dir['url'];// https://accelboon.com/tn/wp/wp-content/uploads/2015/10 echo $wp_upload_dir['suburl'];// /2015/10 echo $wp_upload_dir['baseurl'];// https://accelboon.com/tn/wp/wp-content/uploads echo $wp_upload_dir['basedir'];// /www/accelboon.com/tn/wp-content/uploads print_r( $wp_upload_dir); |