How to get nav_menu_item_id and slug from wp database

Hi @Anjum: I think the function get_nav_menu_id_by_page_template()is what you are looking for? You can place the code for this function in your theme’s functions.php file, or in a .php for a plugin you are writing: function get_nav_menu_id_by_page_template($template) { static $nav_menu_id; if (!isset($nav_menu_id)) { global $wpdb; $sql = <<<SQL SELECT menu.post_id AS menu_id FROM {$wpdb->postmeta} AS … Read more

Importing Direct to DB – GUID Question

Short answer: yes The GUID field is meant to represent a globally unique identifier for the post. In WordPress we just happen to use the URL. The GUID field should never be thought of as an actual URL, though … just an identifier for the post. In reality, the GUID field could contain anything that’s … Read more

When to use custom DB tables or add_option?

For the record, I will never encourage developers to use custom database tables. Yes, they’re easy to use, but you lose 100% of the data abstraction provided by WordPress. add_option()/update_option()/get_option() are basic key-value functions. They store data in a MySQL LONGTEXT field. LONGTEXT can store over 4 million characters … so a 10000+ character option … Read more

Problem with admin login after deployment

I suspect either the culprit is one of the plugins or the theme you are using. so, try: -deactivating ALL plugins temporarily to narrow down the problem. If the problem goes away, activate them individually (one-by-one) to find the problematic plugin. If you don’t have access to your admin area, try deactivating plugins manually via … Read more