Kiran

Forum Replies Created

Viewing 15 posts - 3,736 through 3,750 (of 6,022 total)
  • Author
    Posts
  • in reply to: Down & upgrade package #444421

    Kiran
    Moderator
    Post count: 7069

    Hello Kai,

    You can restrict showing packages from user in package list dropdown by using following code snippet.

    
    
    /* Restrict package during upgrade */
    function _gd_custom_restrict_upgrade_package_query( $sql ) {
    	global $post, $wpdb;
    
    	if ( empty( $_REQUEST['pid'] ) || empty( $_REQUEST['package_id'] ) ) {
    		return $sql;
    	}
    
    	if ( is_admin() || ! ( ! empty( $post ) && $post->ID == $_REQUEST['pid'] ) ) {
    		return $sql;
    	}
    
    	if ( ! geodir_is_page( 'add-listing' ) ) {
    		return $sql;
    	}
    
    	$package_id = geodir_get_post_meta( absint( $_REQUEST['pid'] ), 'package_id', true );
    
    	$restrict_packages = array();
    
            // DO STUFF HERE
    	if ( $package_id == 12 ) {
    		$restrict_packages = array( 1, 2, 3, 4 );
    	}
    
    	/* // Example
    	if ( $package_id == 21 ) {
    		$restrict_packages = array( 1, 2, 3, 4, 12 );
    	}
    
    	if ( $package_id == 2 ) {
    		$restrict_packages = array( 1 );
    	}
    	*/
    
    	if ( ! empty( $restrict_packages ) ) {
    		$sql = str_replace( "where status=1  and post_type =", "WHERE status = 1 AND pid NOT IN( '" . implode( "','", $restrict_packages ) . "' ) AND post_type =", $sql );
    	}
    
    	return $sql;
    }
    add_filter( 'geodir_package_list_query', '_gd_custom_restrict_upgrade_package_query', 10, 2 );

    Add above snippet in your child theme functions.php or execute via any PHP snippet plugin.
    For example i have used to hide packages 1, 2, 3, 4 from user if current listing being upgrade has package id 12.
    Change that lines with your package id.

    Thanks,
    Kiran

    in reply to: After Adding Location – No item found #444420

    Kiran
    Moderator
    Post count: 7069

    Hello Ansen,

    Issue has been fixed.

    I have done:
    – Diactivate > Activate the GeoDirectory & Location Manager plugins
    – Run tool from “GeoDirectory > Status > Tools > Clear version numbers”

    Please check and let us know.

    Thanks,
    Kiran

    in reply to: After Adding Location – No item found #444357

    Kiran
    Moderator
    Post count: 7069
    This reply has been marked as private.
    in reply to: After Adding Location – No item found #444291

    Kiran
    Moderator
    Post count: 7069
    This reply has been marked as private.
    in reply to: import RTL data #444290

    Kiran
    Moderator
    Post count: 7069

    Hello Shahram,

    After doing some debugging found that there is conflict with “WP-Persian” plugin. WP-Persian plugin have options that translate date numbers into non-english language. Ex it translates post date to ۱۳۹۷-۰۵-۲۳ ۱۴:۰۹:۳۵, and during post insert/update it raises error. That’s why it refuses to import post.

    You can fix this by one of following:
    1) Remove post_date column from csv
    2) Disable date number translation from WP-Persian
    2) Add following code snippet in your child theme functions.php or execute via any PHP snippet plugin.

    
    
    function _gd_custom_fix_wpp_conflict() {
    	if ( class_exists( 'WPP_Hooks' ) && ! empty( $_REQUEST['task'] ) && $_REQUEST['task'] == 'import_post' && ! empty( $_REQUEST['action'] ) && $_REQUEST['action'] == 'geodir_import_export' ) {
    		remove_filter( 'date_i18n', array( 'WPP_Hooks', 'wpp_date_i18n' ) );
    	}
    }
    add_action( 'admin_init', '_gd_custom_fix_wpp_conflict', 10 );

    Kiran

    in reply to: Data disappears when downgrading #444288

    Kiran
    Moderator
    Post count: 7069

    Hello,

    Did you updated(saved) listing before listing update?

    Please check this https://wpgeodirectory.com/support/topic/paid-plan-downgradeexpiry-to-free-not-losing-data/#post-355789

    Let us know.

    Kiran

    in reply to: import RTL data #444200

    Kiran
    Moderator
    Post count: 7069
    This reply has been marked as private.
    in reply to: Listings renewal #444178

    Kiran
    Moderator
    Post count: 7069

    Hello Alex Howes,

    If listing renewed under same package then it should add remaining days to new expire date. Ex: if you renew the listing before 10 days of expire date then it will set a new expire date by adding 40 days (10 + 30 ) to today.

    Please send us admin credentials if it not doing so.

    Kiran

    in reply to: import RTL data #444175

    Kiran
    Moderator
    Post count: 7069

    Hello,

    It still not showing any files/directory (see attachment). You have to give access to root WordPress to FTP account testgd. This is managed from CPanel > FTP Accounts.

    Kiran

    in reply to: Display Number of Listings in Search Results #444153

    Kiran
    Moderator
    Post count: 7069

    Hello Gui,

    You can use $numposts = $wp_query->found_posts; to retrieve posts count.

    Usage:

    
    
    global $wp_query;
    $numposts = $wp_query->found_posts;

    You can get help from current pagination function https://wpgeodirectory.com/codex/codex/geodirectory_functions/geodir_pagination/

    Kiran

    in reply to: import RTL data #444145

    Kiran
    Moderator
    Post count: 7069

    Hello Shahram,

    The FTP account you provided has no wordpress directory access. It not showing any files/directory after connecting via FTP client. Please give root directory access to that account.

    I have tested same csv file you attached with import/export/re-import in my test site and it imported without any issue.

    Let us know.

    Thanks,
    Kiran

    in reply to: Make location switcher default to Country #444144

    Kiran
    Moderator
    Post count: 7069

    Hello Benjamin,

    Try following code snippet to get country tab by default selected.

    
    
    
    /* Location switcher default tab */
    function _gd_custom_location_switcher_default_tab( $default_tab ) {
    	$default_tab = 'country'; // country, region, city, neighbourhood (if active)
    	return $default_tab;
    }
    add_filter( 'geodir_location_switcher_default_tab', '_gd_custom_location_switcher_default_tab', 10, 1 );
    

    Kiran

    in reply to: After Adding Location – No item found #444143

    Kiran
    Moderator
    Post count: 7069
    This reply has been marked as private.

    Kiran
    Moderator
    Post count: 7069

    Hello,

    We have reversed our previous changes, so now you can search with both special apostrophe or normal apostrophe.
    It will be in next release. You can update patch from here https://github.com/GeoDirectory/geodirectory/pull/472/commits/e08f14209a31695504faf3e48902ab0ed208318a

    Kiran

    in reply to: short code for filtering listings #443835

    Kiran
    Moderator
    Post count: 7069

    Hello,

    Is there some way of forcing the coordinates of the map to display?

    No, currently it is not possible.

    Also on another note, no description content shows up in the pop-up map listing.
    How do I get this to show?

    Try following code snippet to display description on map popup.

    
    
    function _gd_custom_desc_on_popup( $post_object, $preview = false ) {
    	$post = get_post( $post_object->ID );
    
    	$desc = geodir_utf8_substr( strip_tags( $post->post_content ), 0, 140 );
    
    	if ( $desc ) {
    		echo '<div class="geodir_more_info geodir_content" style="clear:both;"><span class="geodir-i-contact" style="">' . __( 'Desc:', 'geodirectory' ) . ' </span>' . geodir_utf8_substr( strip_tags( $post->post_content ), 0, 140 ) . '</div>';
    	}
    }
    add_action( 'geodir_infowindow_meta_after', '_gd_custom_desc_on_popup', 10, 2 );

    Kiran

Viewing 15 posts - 3,736 through 3,750 (of 6,022 total)
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount