Kiran

Forum Replies Created

Viewing 15 posts - 1,951 through 1,965 (of 6,022 total)
  • Author
    Posts

  • Kiran
    Moderator
    Post count: 7069

    Hello,

    If I make a blog CPT, can users create categories front-end?

    Front-end users are not allowed to create categories. Only admin have permission to create new categories.

    Kiran


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

    Kiran
    Moderator
    Post count: 7069

    Hello Markus,

    Is there a way to use a gd_category as a filter, when exporting.
    Instead of adding Post Types.
    For me it seems Post Types and Categories are same.

    Sorry, currently it is not possible to export listings for particular category/categories.

    But you can use following PHP snippet to export listings for particular category.

    
    
    /**
     * Export listings by category.
     */
    function gd_snippet_240619_export_filter_category( $where, $post_type ) {
    	global $wpdb;
    
    	
    	/*** CATEGORY ID ***/
    	$category_id = 34;
    	/*** CATEGORY ID ***/
    	
    	$table = geodir_db_cpt_table( $post_type );
    
    	$where .= $wpdb->prepare( " AND ( FIND_IN_SET( %d, {$table}.post_category ) OR {$table}.default_category = %d )", array( $category_id, $category_id ) );
    
    	geodir_error_log( $where, $post_type, __FILE__, __LINE__ );
    	return $where;
    }
    add_filter( 'geodir_get_posts_count', 'gd_snippet_240619_export_filter_category', 100, 2 );
    add_filter( 'geodir_get_export_posts','gd_snippet_240619_export_filter_category', 100, 2 );

    Regards,
    Kiran

    in reply to: Few Issues after upgrade #494442

    Kiran
    Moderator
    Post count: 7069
    This reply has been marked as private.
    in reply to: Few Issues after upgrade #494439

    Kiran
    Moderator
    Post count: 7069
    This reply has been marked as private.
    in reply to: Few Issues after upgrade #494435

    Kiran
    Moderator
    Post count: 7069

    Hello hezekiah,

    This has been fixed and it will be in next release.

    Please provide us FTP credentials if you want me to apply patch on your site.

    Regards,
    Kiran


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

    Kiran
    Moderator
    Post count: 7069

    Hi Vivek,

    Try following PHP snippet to export post modified date.

    
    
    function gd_snippet_240619_export_posts_columns( $columns, $post_type ) {
    	global $wpdb;
    
    	$columns[] = "{$wpdb->posts}.post_modified";
    
    	return $columns;
    }
    add_filter( 'geodir_get_export_posts_columns', 'gd_snippet_240619_export_posts_columns', 10, 2 );

    Regards,
    Kiran

    in reply to: Social Importers queries #494187

    Kiran
    Moderator
    Post count: 7069

    Hello marktowers,

    I have checked and found that due to privacy problem, it not provides protected content(description, event schedules, phone, email etc.) when fetching event page content by direct url.

    Kiran

    in reply to: filtering neighborhoods in widget logic #494185

    Kiran
    Moderator
    Post count: 7069

    Hi Joe,

    Neighborhood slug only applicable to archive pages urls like location, categories etc.

    Use following PHP snippet to achieve what you asked.

    
    
    /**
     * Usage: gd_widget_logic_post_neighborhood() == 'my-neighborhood-slug'
     */
    function gd_widget_logic_post_neighborhood() {
    	global $gd_post;
    
    	$neighborhood = '';
    	if ( ! empty( $gd_post ) && ! empty( $gd_post->neighbourhood ) && ( geodir_is_page( 'detail' ) || geodir_is_page( 'preview' ) ) ) {
    		$neighborhood = $gd_post->neighbourhood;
    	}
    
    	return $neighborhood;
    }

    Steps:
    1) Put above snippet in theme/child theme functions.php file or add via any PHP Snippets plugin
    2) Use

    gd_widget_logic_post_neighborhood() == 'my-neighborhood-slug'

    Kiran

    in reply to: I can not translate Near: My location #494165

    Kiran
    Moderator
    Post count: 7069

    Hello,

    Now FTP credentials are working.

    I have checked file geodirectory-es_ES.po and found it has some
    keywords missing in “X-Poedit-KeywordsList” parameter.

    I have added those keywords and re-scan & saved .po file.
    See for more details: https://wpgeodirectory.com/support/topic/some-translations-dont-work-2/#post-484624

    Now translation is working fine.

    Please check and let us know.

    Regards,
    Kiran


    Kiran
    Moderator
    Post count: 7069

    Hi Terry,

    Custom posts types listing content should not setup with page builder. Page builder setups the page layout, section, rows and content. GeoDirectory custom post types has its own layout for archive, detail pages.

    Page builder should be used on GeoDirectory page templates which are available at GeoDirectory > Settings > Pages.

    Let us know.

    Kiran

    in reply to: GeoDirectory Search Not Working Correctly #494162

    Kiran
    Moderator
    Post count: 7069

    Que1. Are you providing this type of customization or I have to hire from somewhere else? If Yes, What will be the cost of adding a radius slider bar in search?

    We do not provide paid customization. You can find help here:
    https://geodirectoryexperts.com

    Que2. Can we use the driving path instead of crow flies path or direct lines that cross rivers path to measure distance in search?

    No, this is not possible with search.

    Que3. Can we sort the professional listing by some custom keyword?

    You can achieve this by using hooks.
    Here are examples:
    https://wpgeodirectory.com/support/topic/sort-by-featured-and-rating/#post-394349
    https://wpgeodirectory.com/support/topic/search-radius-not-working/page/3/#post-452121

    Kiran

    in reply to: Place not display in GeoDirectory #494158

    Kiran
    Moderator
    Post count: 7069

    Hello,

    Use following PHP snippet to display post excerpt when description is empty.

    
    
    /**
     * Show post excerpt when post description is empty.
     */
    function gd_snippet_210619_custom_field_output_post_excerpt( $html, $location, $cf, $output ) {
    	global $gd_post;
    
    	if ( ! empty( $gd_post ) && empty( $gd_post->post_content ) && ! empty( $gd_post->post_excerpt ) ) {
    		$post_excerpt = $gd_post->post_excerpt;
    
    		$extra_fields = ! empty( $cf['extra_fields'] ) ? stripslashes_deep( maybe_unserialize( $cf['extra_fields'] ) ) : NULL;
    		$field_icon = geodir_field_icon_proccess( $cf );
    		$output = geodir_field_output_process( $output );
    
    		if ( strpos( $field_icon, 'http' ) !== false ) {
    			$field_icon_af = '';
    		} elseif ( $field_icon == '' ) {
    			$field_icon_af = '';
    		} else {
    			$field_icon_af = $field_icon;
    			$field_icon = '';
    		}
    
    		$max_height = ! empty( $output['fade'] ) ? absint( $output['fade'] ) . "px" : '';
    		$max_height_style = $max_height ? " style='max-height:$max_height;overflow:hidden;' " : '';
    		
    		$html = '<div class="geodir_post_meta ' . $cf['css_class'] . ' geodir-field-' . $cf['htmlvar_name'] . '" ' . $max_height_style . '>';
    
    		if ( $output == '' || isset( $output['icon'] ) ) $html .= '<span class="geodir_post_meta_icon geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
    		if ( $output == '' || isset( $output['label'] ) ) $html .= trim( $cf['frontend_title'] ) != '' ? '<span class="geodir_post_meta_title" >'.__( $cf['frontend_title'], 'geodirectory') . ': '.'</span>' : '';
    		if ( $output == '' || isset( $output['icon'] ) ) $html .= '</span>';
    
    		if ( $output == '' || isset( $output['value'] ) ) {
    			$content =  wp_strip_all_tags( do_shortcode( wpautop( stripslashes( $post_excerpt ) ) ) );
    
    			if ( $content ) {
    				if ( ! empty( $output['limit'] ) ) {
    					$content = wp_trim_words( $content, absint( $output['limit'] ), '' );
    				}
    				$html .= $content;
    
    				if ( isset( $output['more'] ) ) {
    					$more_text = empty( $output['more'] ) ? __( "Read more...","geodirectory" ) : __( $output['more'], "geodirectory" );
    					$link_class = ! empty( $output['fade'] ) ? 'gd-read-more-fade' : '';
    					$html .= " <a href='" . get_permalink( $gd_post->ID ) . "#" . $cf['htmlvar_name'] . "' class='gd-read-more $link_class'>" . esc_attr( $more_text ) . "</a>";
    				}
    			}
    		}
    
    		$html .= '</div>';
    	}
    	return $html;
    }
    add_filter( 'geodir_custom_field_output_textarea_var_post_content', 'gd_snippet_210619_custom_field_output_post_excerpt', 100, 4 );

    Kiran

    in reply to: When adding a new listing, location doesn't save #494154

    Kiran
    Moderator
    Post count: 7069
    This reply has been marked as private.
Viewing 15 posts - 1,951 through 1,965 (of 6,022 total)
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount