Hi,
Thanks for sending all these info, these really help me to fix the problem.
Everything should work fine now. Plz check and let me know.
If anyone else has same problem of missing default GD pages please follow these instructions
1. Put below code in ur theme’s functions.php file.
function geodir_restore_default_pages()
{
//geodir_create_page( esc_sql( _x('home-map', 'page_slug', 'geodirectory') ), 'geodir_home_map_page', __('Home Map', 'geodirectory'), '',0,'publish' );
geodir_restore_default_page( esc_sql( _x('listings', 'page_slug', GEODIRECTORY_TEXTDOMAIN) ), 'geodir_listing_page', __('All Listings', GEODIRECTORY_TEXTDOMAIN), '' );
geodir_restore_default_page( esc_sql( _x('add-listing', 'page_slug', GEODIRECTORY_TEXTDOMAIN) ), 'geodir_add_listing_page', __('Add Listing', GEODIRECTORY_TEXTDOMAIN), '' );
geodir_restore_default_page( esc_sql( _x('listing-preview', 'page_slug', 'geodirectory') ), 'geodir_preview_page', __('Listing Preview', GEODIRECTORY_TEXTDOMAIN), '' );
geodir_restore_default_page( esc_sql( _x('listing-success', 'page_slug', GEODIRECTORY_TEXTDOMAIN) ), 'geodir_success_page', __('Listing Success', GEODIRECTORY_TEXTDOMAIN), '' );
geodir_restore_default_page( esc_sql( _x('location', 'page_slug', GEODIRECTORY_TEXTDOMAIN) ), 'geodir_location_page', __('Location', GEODIRECTORY_TEXTDOMAIN), '' );
}
function geodir_restore_default_page( $slug, $option, $page_title = '', $page_content = '', $post_parent = 0,$status = 'virtual' )
{
global $wpdb, $current_user;
$page_found = $wpdb->get_var(
$wpdb->prepare(
"SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s LIMIT 1;",
array($slug)
)
);
if ($page_found) :
// Page exists
update_option($option, $page_found);
return;
endif;
$page_data = array(
'post_status' => $status,
'post_type' => 'page',
'post_author' => $current_user->ID,
'post_name' => $slug,
'post_title' => $page_title,
'post_content' => $page_content,
'post_parent' => $post_parent,
'comment_status' => 'closed'
);
$page_id = wp_insert_post($page_data);
add_option($option, $page_id);
}
add_action('init' , 'geodir_restore_default_pages') ;
2. once u find that everything is working fine now just remove this piece of code from theme’s functions.php file
Thanks for ur patience.