get_the_id()
- Description : Retrieve the ID of the current item in the WordPress Loop. (반환 함수)
- URL : WordPress.org | Code Reference : https://developer.wordpress.org/reference/functions/get_the_id/
- Ex :
$page_id = intval(get_the_id()); if( get_the_id() == '14195' ) { //your code }
the_ID()
- Description : Display the ID of the current item in the WordPress Loop. (출력 함수)
Displays the numeric ID of the current post. This tag must be within The Loop.
Note : This function displays the ID of the post, to return the ID use get_the_ID().
- URL : WordPress.org | Code Reference : https://developer.wordpress.org/reference/functions/the_id/
function the_ID() { echo get_the_ID(); }
- Usage :
Post Number:
get_current_blog_id()
- Description : Retrieve the current site ID. / Retrieve the current blog id. (멀티사이트에서 현재 사이트의 아이디값을 반환)
- URL : WordPress.org | Code Reference : https://developer.wordpress.org/reference/functions/get_current_blog_id/
- URL : WordPress.org | Codex : https://codex.wordpress.org/Function_Reference/get_current_blog_id
- Usage :
$blog_id = get_current_blog_id();
'WordPress > Action Hook, Filter Hook, Function' 카테고리의 다른 글
language_attributes, bloginfo, ICL_LANGUAGE_CODE (0) | 2019.07.27 |
---|---|
[WordPress] Conditional Tags (0) | 2018.12.24 |
[Wordpress] WooCommerce Visual Hook Guide: Single Product Page (0) | 2018.12.13 |
[Wordpress] woocommerce_short_description filter (0) | 2018.12.13 |
[Wordpress] Disable "Are you sure you want to log out?" Message (0) | 2018.11.04 |