places_locator table not updating
-
I’ve inherited a project that was coded by another developer. For a single post result, the address and other contact information that is displayed does not match what is being displayed for the search results page.
Here is the applicable line of code that is retrieving the data from the places_locator table (idw_ prefix in my particular case):$results = $wpdb->get_row('SELECT * FROM idw_places_locator WHERE post_id ='.$postid, ARRAY_A);
I’ve looked in the table and I see that the data in that table does not match what I have entered into the associated location info for that post.
See screenshot above for example of the contact info for the given page.
And here you can see it doesn’t display the data
According to this page: https://docs.geomywp.com/article/154-posts-locator-function-gmwupdatepostlocation “With GEO my WP, by default, it is possible to geotag a post via the location form of the “Edit Post” page of the admin’s dashboard only.
So, I would expect that when I edit the post, then the idw_places_locator table would be updated, but when I inspect that table I can see that it does not.
What am I missing?
Here’s the full block of code that is responsible for displaying the contact info for the post:
$postid = get_the_ID();
$results = $wpdb->get_row('SELECT * FROM idw_places_locator WHERE post_id ='.$postid, ARRAY_A);
$dentist_email = $results['email'];?>
<div id="dentist-info">
<div class="one-half first">
<span class="address-label">Address:</span>
<p><?php echo $results['street'];?> <?php echo $results['apt'];?> <br />
<?php echo $results['city'];?> <?php echo $results['state'];?> <?php echo $results['zipcode'];?></p>
<?php /*if ($dentist_email !=""){?><a class="fancybox-inline" href="#fancyboxID-SM"><button>click to contact</button></a><?php }*/?>
</div>
<div class="one-half">
<span class="address-label">Phone:</span>
<p><?php echo $results['phone'];?></p>
<span class="address-label">Website:</span>
<p><?php
$website = $results['website'];
echo '<a href="'.$website.'" rel="nofollow" target="_blank" id="website-link">'.$results['website'].'</a>';?>
</p>
</div>
</div>I can verify that this is working for other posts. The data for this post just isn’t being updated to the idw_places_locator table when that post is saved as I would expect. In other words, it is correct for this page (from a coding standpoint) to be displaying nothing, because those fields are indeed empty for this post in the idw_places_locator, even though you can see that there is data in the phone and website fields in the location section of that post in the back end.
The page I need help with: [log in to see the link]
- You must be logged in to reply to this topic.