• Resolved James Gill

    (@james-gill)


    Hi,

    I’m using the wp all import plugin (https://www.wpallimport.com/) to import jobs to my site via an xml feed.

    It’s creating all the posts correctly with all the required fields filled in. The posts are published and can be viewed directly.

    But the jobs aren’t appearing in the search until I manually go into the post and click update.

    The problem being is that this jobs feed is from an external site, and I’d like to run a cron job to re import the xml feed daily. It updates the posts correctly, but any new posts that are added always require a manual update.

    I’m filling in all the required fields, but not the geolocation data, I notice that this seems to be added after manual update? Is there any way I can get this to work without importing the geolocation data? or is there something else i’m missing?

    https://www.ads-software.com/plugins/wp-job-manager/

Viewing 15 replies - 1 through 15 (of 17 total)
  • Plugin Author Mike Jolley (a11n)

    (@mikejolley)

    You may be missing _featured and _filled – set these meta values both to 0 during your import.

    Thread Starter James Gill

    (@james-gill)

    Thanks, that’s what I was missing.

    Working great now ??

    Hey,

    I’m really interrested by you said.

    Is “wp all import” compatible with Wp Job Manager ? Because I’m getting some job data from an XML feed (external), but all jobs are saved as Post instead of Job in my back office.

    How can I do ?

    Plugin Author Mike Jolley (a11n)

    (@mikejolley)

    @surpriz you need to set the post type to job_listing – I believe WP All Import has support for that.

    You may be missing _featured and _filled – set these meta values both to 0 during your import.

    Not doing the trick for me…
    Using Listify theme + wp job manager + wp all import
    Any ideas?

    Plugin Author Mike Jolley (a11n)

    (@mikejolley)

    Hey Mike, not sure if you picked up my email but, no joy for me either. It just doesn’t seem to be triggering the geo coding, they are coming up as listing but nothing else – can you help?

    Mike, also chucked in the PHP code under the theme footer which you suggested in a previous post and the string I got back was:

    rray(5) { [“headers”]=> array(11) { [“content-type”]=> string(31) “application/json; charset=UTF-8” [“date”]=> string(29) “Wed, 17 Dec 2014 16:45:20 GMT” [“expires”]=> string(29) “Thu, 18 Dec 2014 16:45:20 GMT” [“cache-control”]=> string(21) “public, max-age=86400” [“vary”]=> string(15) “Accept-Language” [“access-control-allow-origin”]=> string(1) “*” [“server”]=> string(4) “mafe” [“x-xss-protection”]=> string(13) “1; mode=block” [“x-frame-options”]=> string(10) “SAMEORIGIN” [“alternate-protocol”]=> string(14) “80:quic,p=0.02” [“connection”]=> string(5) “close” } [“body”]=> string(1340) “{ “results” : [ { “address_components” : [ { “long_name” : “California”, “short_name” : “CA”, “types” : [ “administrative_area_level_1”, “political” ] }, { “long_name” : “United States”, “short_name” : “US”, “types” : [ “country”, “political” ] } ], “formatted_address” : “California, USA”, “geometry” : { “bounds” : { “northeast” : { “lat” : 42.0095169, “lng” : -114.131211 }, “southwest” : { “lat” : 32.5342321, “lng” : -124.4096196 } }, “location” : { “lat” : 36.778261, “lng” : -119.4179324 }, “location_type” : “APPROXIMATE”, “viewport” : { “northeast” : { “lat” : 42.0095169, “lng” : -114.131211 }, “southwest” : { “lat” : 32.5342321, “lng” : -124.4096196 } } }, “types” : [ “administrative_area_level_1”, “political” ] } ], “status” : “OK” } ” [“response”]=> array(2) { [“code”]=> int(200) [“message”]=> string(2) “OK” } [“cookies”]=> array(0) { } [“filename”]=> NULL }

    Which looks all good to me?

    Plugin Author Mike Jolley (a11n)

    (@mikejolley)

    The version which automatically triggers geolocation after import hasn’t been released yet.

    Oh really? I thought there was code in the plugin which did it already. What sort of time frame would I be looking at? Cheers Mike – great plugin by the way!

    https://wpjobmanager.com/document/tutorial-importing-job-listings-wp-import-pro/

    I followed that tutorial, without success.
    But now I read that the version of the plugin that triggers geolocation after import, hasn’t been released.

    I thought it did that already.
    thnks

    Or do you guys know of any alternative to fix geolocation on 3000 listings ?

    Plugin Author Mike Jolley (a11n)

    (@mikejolley)

    I think it will be out this week.

    @hjbarraza Saving listings triggers geolocation, or you can write a script to do it via PHP. You would need to be careful though to avoid google’s limits.

    Thnks !
    Brilliant,
    I think I’ll wait for the new release.
    I’m afraid I end up breaking things or being nudged by google.
    ??

    So… I went ahead and try to solve it anyway… and miraculously managed to do so.
    There are probable several smarter ways to do it, but this is how I did it.:

    1. Create a new page template (in my case, I called in “mass update”) and include the snippet at the end of this reply
    2. Publish a new page (so it can be called on cron
    3. Visit the page/ or program a cronjob

    Code:

    <?php
    /**
     * Template Name: Mass Updater
     *
     * @package Nope
     */
    
    get_header(); ?>
    
    <h1>Updating...</h1>
    
    <?php
    	$args = array( 'posts_per_page' => 20, 'offset'=> 1, 'post_type' => 'job_listing' );
    	$jobs = get_posts( $args );
    
    // loop through every part
    	foreach ( $jobs as $job ) {
        // get part number
    
    		$address = get_post_meta($job->ID, '_job_location', true);
    		$address_data = WP_Job_Manager_Geocode::get_location_data($address);
    		WP_Job_Manager_Geocode::save_location_data( $job->ID, $address_data );
    
    		echo $job->ID . " " . $address . "<br/>"; 
    
    	}
    ?>
    
    <?php get_footer(); ?>

    Please note that I’m running it on local server, I haven’t tried it with my full database.

    The change every single post/listing change “‘posts_per_page’ => 20” to “‘posts_per_page’ => -1” or you can combine the query with “offset => 20” to decrease the load on google’s api as Mike suggested.

    Or you could use the “sleep($miliseconds);” function between each update.

    You can find the more on how to use the offset variable here: /Class_Reference/WP_Query

    hi can i use this plugin to import category for my list (job). I have loads of category and entering them manually not a good choice time wise..( I am using Listify theme).

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘WP Job Manager listing jobs with WP all import’ is closed to new replies.