Robert Strobel

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 40 total)
  • Author
    Posts
  • in reply to: Pagination #412942

    Robert Strobel
    Expired Member
    Post count: 54

    Thanks a lot Kiran. Much appreciated.

    in reply to: SEOUltimate plugin – on GeoDir Category pages #412307

    Robert Strobel
    Expired Member
    Post count: 54

    Ok i’m looking for a short term solution not v2, give me a heads up… how can it be done?

    in reply to: SEOUltimate plugin – on GeoDir Category pages #412223

    Robert Strobel
    Expired Member
    Post count: 54

    We have different titles and different meta tags plus different images per category, they do not all follow a format like the defaults…

    in reply to: SEOUltimate plugin – on GeoDir Category pages #412222

    Robert Strobel
    Expired Member
    Post count: 54

    Because first of all we need a title, desc and also OG tags and an image meta too.. i dont see those options from GD

    in reply to: SEOUltimate plugin – on GeoDir Category pages #412184

    Robert Strobel
    Expired Member
    Post count: 54
    This reply has been marked as private.
    in reply to: SEOUltimate plugin – on GeoDir Category pages #412177

    Robert Strobel
    Expired Member
    Post count: 54
    This reply has been marked as private.
    in reply to: Insert/Update Listings from Plugin #407384

    Robert Strobel
    Expired Member
    Post count: 54

    Thanks a bunch Stiofan!!

    Here’s the code I used for any users who may have same query I had:

    
    
    
    global $wpdb, $plugin_prefix;
    	$existing = $wpdb->get_results($wpdb->prepare(
    				"SELECT * FROM {$wpdb->posts} p JOIN " . ($plugin_prefix . 'gd_customdir_detail') . " gd ON gd.post_id=p.ID WHERE gd.geodir_test_val=%d LIMIT 1",
    				array(1000)
    			));//works
    

    We’re set now. Thanks for the help again.

    in reply to: Insert/Update Listings from Plugin #407296

    Robert Strobel
    Expired Member
    Post count: 54

    Ok so I installed that and looked at the documentation. Straight forward but I see no examples or references on filtering.

    I tried normal wordpress filtering but it didn’t work

    
    
    $curl = curl_init();
    	$field_string = http_build_query(array(
    		'filter[meta_query]' => array(
    	    	array (
    		        'key' => 'geodir_test_val',
    		        'value' => "1000",
    	    	)
    	    ),
    	));
    	curl_setopt_array($curl, array (
    	    CURLOPT_RETURNTRANSFER => 1,
    	    CURLOPT_URL => site_url('wp-json/geodir/v1/customdir?' . $field_string)
    	  )
    	);
    	$existing = json_decode(curl_exec($curl));

    However the above code brings back all listings and not filtered by field/meta.

    I understand replies take a little bit of time. Are you able to guide me here as I don’t see anything further on the REST API docs.. thanks!

    in reply to: Insert/Update Listings from Plugin #407275

    Robert Strobel
    Expired Member
    Post count: 54

    What would the rest api URL be for filtering the listing by custom field?

    in reply to: Insert/Update Listings from Plugin #407252

    Robert Strobel
    Expired Member
    Post count: 54

    This is for simply getting the post data nbased on a meta key. That is not even possible?

    I know update/insert what stiofan mentioned.. that’s already covered. But i’m talking about just getting the post data ie post id.

    in reply to: Insert/Update Listings from Plugin #407233

    Robert Strobel
    Expired Member
    Post count: 54

    Thanks Alex.

    I tried this simple query to retrieve listings by custom field value. Since I first need the $post_id to use geodir_get_post_info() or _get_post_meta() —

    
    
    $existing = (new WP_Query(array(
    		"meta_query"	=> array(
    			array(
    				"key"	=> "geodir_test_val",
    				"value"	=> "100",
    				// 'compare' => 'IN'
    			)
    		)
    	)))->posts;

    However this returns an empty array, however there is a listing with the custom field value “100” as I created it manually to test with.

    Much thanks for info so far. It has been helpful and insightful.

    in reply to: Insert/Update Listings from Plugin #407221

    Robert Strobel
    Expired Member
    Post count: 54

    Thank you very much.

    Lastly, for custom fields, is there some prefix?

    If i made a custom field called “Test Val” and it’s html variable is test_val then what would the meta key be? Would it be geodir_test_val or would it be test_val?

    in reply to: Insert/Update Listings from Plugin #407206

    Robert Strobel
    Expired Member
    Post count: 54

    My use case is:
    We have a variable called

    $testvalue = "testval";

    We want to use this $testvalue to update geo directory listings that have a custom field “Test Val” as the same value a this variable $testvalue
    Also, we want to be updating other custom fields within the geodir_save_listing() call

    The goal is to insert a record if it does not already exist with the custom field as $testvalue and if it exists, then update instead

    in reply to: Insert/Update Listings from Plugin #407192

    Robert Strobel
    Expired Member
    Post count: 54

    Thank you Stiofan for that link! Very helpful
    To confirm, geodir_save_listing() can be used for both insert and update right? Would you be able to give a simple example of an update based on custom field?

    Which function would I use to get a listings data? Maybe something like geodir_get_listing?

    Thanks again!

    in reply to: Function to generate Categories #29496

    Robert Strobel
    Expired Member
    Post count: 54

    Thanks

    FYI i found the following code that helped me with taxonomy usage for caegories..

    pasting for anyone else who may read with the same need..

    
    
    function geodir_taxonomy_breadcrumb() {
    	
    	$term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
     	$parent = $term->parent;
    	
    	while ($parent):
    		$parents[] = $parent;
    		$new_parent = get_term_by( 'id', $parent, get_query_var( 'taxonomy' ));
    		$parent = $new_parent->parent;
    	endwhile;
    	
    	if(!empty($parents)):
    		$parents = array_reverse($parents);
    		 
    		foreach ($parents as $parent):
    			$item = get_term_by( 'id', $parent, get_query_var( 'taxonomy' ));
    			$url = get_term_link( $item, get_query_var( 'taxonomy' ) ); 
    			echo '<li> > <a href="'.$url.'">'.$item->name.'</a></li>';
    		endforeach;
    
    	endif;
    	 
    	echo '<li> > '.$term->name.'</li>';
    }
Viewing 15 posts - 1 through 15 (of 40 total)