Support » Plugin: Open User Map | Everybody can add locations » Info missing from Single Pages for locations

  • Resolved anilmehtamex

    (@anilmehtamex)


    The plugin description says that single pages for locations are automatically created however the page appears almost blank and does not have the listing info/images?

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author 100plugins

    (@100plugins)

    Currently the feature only sets the basics by allowing single pages for locations. You will still have to create a template on your own to layout the content according to your theme.

    The template file should be called single-oum-location.php and needs to be inside your theme folder. Inside the template you can access the location info with the meta fields “_oum_location_key” and “_oum_location_image”.

    I will also publish a quick “HowTo” on this soon.

    Thread Starter anilmehtamex

    (@anilmehtamex)

    Could you provide a list of the other meta fields for now?

    Plugin Author 100plugins

    (@100plugins)

    Yes! I just published an article on this. There you will find the most recent list of currently available custom fields and some explanation on how to use them:

    https://www.open-user-map.com/how-can-i-access-field-values-of-a-location/

    Hi,

    I was able to access the image using the key.

    However, i’ve probably spent 8 hours trying every combination i can think of to try to access the values below the _oum_location_key from your site and was not able to do it. I even tried figuring it out by looking at the source code but with no success.

    Even when I was able to generate the data from the meta by pulling the entire batch, this is the format it came out as: https://geolocats.com/oum-location/1651093789/

    either as:
    _:ArrayArray
    _:ArrayArray
    _:ArrayArray
    _:ArrayArray
    _:ArrayArray
    _:ArrayArray

    or

    _oum_location_key:a:8:{s:7:"address";s:54:"Wailea, Maui County, Hawaii, 96753-9527, United States";s:3:"lat";d:20.687174899999998700650394312106072902679443359375;s:3:"lng";d:-156.439041500000001860826159827411174774169921875;s:4:"text";s:63:"Large orange tabby. Stripes and white on chin area. Tipped ear.";s:11:"author_name";s:14:"Kelli Medeiros";s:12:"author_email";s:21:"kellimaui@hotmail.com";s:12:"notification";s:2:"on";s:13:"custom_fields";a:3:{i:1650112671253;s:4:"Lost";i:1650112727544;s:7:"1/14/22";i:1650113586301;s:10:"8082505131";}}
    
    _oum_location_image:https://secureservercdn.net/198.71.233.172/7g0.842.myftpupload.com/wp-content/uploads/oum-useruploads/86.jpg
    
    _oum_location_image_thumb:https://secureservercdn.net/198.71.233.172/7g0.842.myftpupload.com/wp-content/uploads/oum-useruploads/86_thumb.jpg
    
    _edit_lock:1651097178:1
    
    _edit_last:1
    
    _oum_location_audio:

    Please help @100plugins

    Please disregard my previous message.

    After some trial and error, I’ve figured it out! 🙂 new to PHP so took me awhile. idk why the other function I made spitted out serialized info. But this one doesn’t require me to unserialize it.

    For anyone who visits this post and wonders, here is the function i used to pull the info and store it to apply my own styles and insert them. (added comments for context)

    function output_all_postmeta() {
    	$i = 0;  // setting the counter
    	$data_post = get_post_meta(get_the_ID(), '_oum_location_key', TRUE); // fetching from the _oum_location_key
    		foreach($data_post as $data_key=>$data_value) {  // going through loop of each key:value pair
    		$meta_index[$i] = $data_value; // designating new variable with counter for the loop so each value is assigned to unique meta_index
    			$i++; // counting up each loop
    	}
    	echo '<p>' . $meta_index[1] . '</p>'; // outputting the value i want outside the loop
    }
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Info missing from Single Pages for locations’ is closed to new replies.