get_page_by_path()
スラッグ名をもつ固定ページのIDを取得する方法
[php]
$slug_name = $category;
$page = get_page_by_path($slug_name);
$page_ID = $page->ID;
[/php]
breadcrumb-navxt
domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init
action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/wordpress/wp-includes/functions.php on line 6114スラッグ名をもつ固定ページのIDを取得する方法
[php]
$slug_name = $category;
$page = get_page_by_path($slug_name);
$page_ID = $page->ID;
[/php]