website screenshot instead of category image in listings

This topic contains 22 replies, has 4 voices, and was last updated by  Kiran 2 years, 3 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #494443

    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

    #494547

    Alex Rollin
    Moderator
    Post count: 27815

    Not at this time, but we will check into it for future versions.

    #494860

    Mark Wolf
    Full Member
    Post count: 100

    @kiran
    ty – i am not a coder, but can follow exact instructions.
    What to do with that snippet?
    Shall I generate a file like gd-export-category-id_xx.php with that snippet code and than run it?

    When so, in wich directory have i to place it, to make it work.
    For example: https://mein-garten.de/gd-export-category-id_xx.php
    Any helping Info is welcome. I really need that snippet 😉 Ty and have a nice day.

    @alex
    Any idea, when this will happen? I think there are many users with large directories who need that. Ty and have a nice day.

    #494924

    Kiran
    Moderator
    Post count: 7069

    Hello Mark,

    PHP snippet can be executed via plugin. There are many free plugins available on WordPress. Ex: https://wordpress.org/plugins/code-snippets/

    See for more info: https://wpgeodirectory.com/docs/useful-plugins/#snippets

    Put above snippet and change $category_id = 34; to your category id that you want to export.

    Kiran

    #495116

    Mark Wolf
    Full Member
    Post count: 100

    Great and very helpfull Information Kiran, tx very much.

    #496484

    Mark Wolf
    Full Member
    Post count: 100

    @kiran

    hi again, i installed the plug in Code Snippets.
    Then i ve created a snippet named gd Export nach Kategorie
    I changed $category_id = 34; to my category id that i want to export.
    It is activated.

    But i am to silly to understand how do to do the export, how to execute the snippet.
    If u find a minute to answer, that would be very kind, ty.
    Have a nice day – Markus

    #496486

    Mark Wolf
    Full Member
    Post count: 100

    @kiran

    oops, seems that after acivating the php snippet, i can use the normal export function. And your snippet filters the export.
    So you must not answer, sorry i did not check that before asking again. Have a nice day – Markus.

    #496668

    Kiran
    Moderator
    Post count: 7069
    This reply has been marked as private.
Viewing 8 posts - 16 through 23 (of 23 total)

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

Open Support Ticket