/ Published in: PHP
This custom function is useful if you want to get the ID of a page.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function get_page_id($page_name) { global $wpdb; $page_name = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_name = '".$page_name."'"); return $page_name; }