Can't add a listings

This topic contains 5 replies, has 3 voices, and was last updated by  Vikas 9 years, 8 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #10327

    We Love Travel Group
    Free User
    Post count: 186

    Hi, on our website: http://www.welovekohphangan.com when a user tries to add a listing from the ‘add listing widget’ link it is just sending them to a listing that is already on our website. This listing has nothing to do with any new users. All our payments are set up and the link should send them to add new listing page with these payment options but it’s not.

    On our other websites this is working fine and we have checked to make sure the settings are the same, which they seem to be.

    Please can somebody have a look and see if they know what the problem is.
    Thank you

    #10345

    Guust
    Moderator
    Post count: 29970

    All your virtual pages are gone. I’ll get Vikas again. He will need your FTP details and phpadmin, so please post them in a private message.

    #10437

    We Love Travel Group
    Free User
    Post count: 186
    This reply has been marked as private.
    #10495

    Vikas
    Full Member
    Post count: 1128

    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.

    #10496

    We Love Travel Group
    Free User
    Post count: 186

    Hi Vikas,

    Great Job and massive thank you for your help again!

    Looks like it’s all working now as it should so do i now remove the code or have you done that on this site already?

    #10497

    Vikas
    Full Member
    Post count: 1128

    I have removed that code from your site.
    These instructions are for others who might have deleted those pages accidentally.

    Thanks

Viewing 6 posts - 1 through 6 (of 6 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket