Tell us what you are trying to do? On this link: hidden link we have on the right side in the bottom a map. I do use for this a view, where I basically like to have only the current post information. For this I have a filter defined "Include only posts with IDs set by the View shortcode attribute "ids" eg. [wpv-view name="view-name" ids="1"]"
Is there any documentation that you are following? https://toolset.com/forums/topic/query-filter-to-display-only-current-post-data-in-view/ and other https://toolset.com/forums/topic/i-cant-filter-view-to-current-post/
Is there a similar example that we can see? For the short code I have my own coding:
add_shortcode( 'mapview', 'mapview_shortcode' );
function mapview_shortcode() {
global $post;
$myCode = do_shortcode('[wpv-view name="map-for-beach-articles" ids="'.$post->ID.'" cached="off"]');
echo $myCode;
}
Somehow it shows me this:
7.898793, 98.295995| 7.89091, 98.2653| 7.876628, 98.275781| 7.843881, 98.293682| 7.9687, 98.279635| 7.820156, 98.297906| 7.806383, 98.29906| 8.041567, 98.276541| 7.774374, 98.306821| 7.778018, 98.296632| 7.767716, 98.306357| above the map.
Any idea how i can off this? I only need the map.
What is the link to your site? hidden link
Do you need more information, such as the view:
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
[wpv-conditional if="( $(wpcf-location) gt '1' )"]
[wpv-map-render map_id="map-10" map_width="100%" map_height="400px" fitbounds="off" general_zoom="10" single_zoom="10" general_center_lat="7.934094" general_center_lon="98.337356"][/wpv-map-render]
<wpv-loop>
[pinnumber location="[types field='location' format='FIELD_LATITUDE, FIELD_LONGITUDE|'][/types]" map_id="map-10" image="[types field='image-in-map-pin-pop-up' width='182' height='124' url='true' resize='crop' separator='|'][/types]" title="[types field='beach-name-pin' separator='|'][/types]"]
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-conditional]
[/wpv-items-found]
[wpv-no-items-found]
[wpml-string context="wpv-views"]No items found[/wpml-string]
[/wpv-no-items-found]
[wpv-layout-end]
and the code using for the short code inside this view:
add_shortcode( 'pinnumber', 'pinnumber_shortcode' );
function pinnumber_shortcode($atts = []) {
$atts = array_change_key_case((array)$atts, CASE_LOWER);
//$atts = shortcode_atts(['location' => '', 'title' => '', 'image' => ''], $atts);
if (!empty($atts['location'])){
echo $atts['location'];
$ars = explode("|",$atts['location']);
foreach ($ars as $ar) {
$ps[] = explode(", ",$ar);
}
$title = array();
if (!empty($atts['title'])){
$title = explode("|",$atts['title']);
}
$images = array();
if (!empty($atts['image'])){
$images = explode("|",$atts['image']);
}
$shortCode = '';
foreach ($ps as $key => $p) {
$shortCode .= '[wpv-map-marker map_id="'.$atts['map_id'].'" marker_id="marker-'.($key+1).'" marker_icon="/wp-content/themes/Impreza-child/mappins/pinnum-'.($key+1).'.png" lat="'.$p[0].'" lon="'.$p[1].'"]';
if(array_key_exists(($key), $title) && !empty($title))
$shortCode .= '<h4>'.$title[$key].'</h4>';
if(array_key_exists(($key), $images) && !empty($images))
$shortCode .= '<img src='.$images[$key].' width="182" height="124" class="aligncenter size-thumbnail"/>';
$shortCode .= '[/wpv-map-marker]';
}
return $shortCode;
}
else return '';
}