Kevin Heath
Forum Replies Created
-
AuthorPosts
-
I’ve just put my site on to Aldehyde – the free version at the moment. Just a couple of tweaks needed so far.
You need to set up a menu and assign it to the primary location for the responsive menu to work. Because it looks like GD automatically adds their pages to the main menu you just need to add home to the menu for it to work. If you don’t set up a menu then it will not work correctly on mobiles.
I need to do a bit of tweaking for the maps to get them to be responsive but its late and I’ve done more than enough for today.
The site on Aldehyde is at http://naturesites.co.uk
Hi Dave
It will need a bit more work as it looks like all the line breaks and paragraphs are being stripped.
There may also be a need for a condtional because if you visit my home page you’ll see the ad being displayed as part of the popular posts lists.
I’m guessing that popular posts list is actually the category with the most listings being displayed.
But as a short term solution until geodirectory sorts it out I guess it is passable.
Kevin
even better – to get the shortcodes to work in the normal wordpress category description:
open geodir-listing.php and at about line 50 you will find:
<div class="term_description"><?php _e( wpautop(wptexturize($current_term->description)), GEODIRECTORY_TEXTDOMAIN ) ; ?></div>
change it to:
<div class="term_description"><?php _e( wpautop(wptexturize(do_shortcode($current_term->description))), GEODIRECTORY_TEXTDOMAIN ) ; ?></div>
and you should be able to run shortcodes.
Kevin
Actually change that,
put your template tags in the geodir-listing.php file just under the term description.
Hi stroudsco
THat’s strange that all the formatting works ok but the shortcodes doesn’t. There must be something in the geodirectory plugin that takes the do shortcode filter out.
If you are using metaslider then you can use the php tag to display the images.
You need to add the template tags to geodirectory-templates > listing-gridview.php and listing-listview.
At the top of the page before the first
- is an option.
I use adrotate and while the shortcode does not work the template tag
<?php echo adrotate_group(1); ?>
This is the test I did – http://naturesites.co.uk/places/national-nature-reserves/
Obviously it is best if the category description works but it is a possible option till the developers have sorted out all the bugs in the plugin.
Change the script in the header to
<?php global $goe_locate; if($goe_locate){echo $goe_locate;} ?> <script type="text/javascript"> function showLocation(position) { var latitude = position.coords.latitude; var longitude = position.coords.longitude; var add = latitude+','+longitude; document.getElementById('detail_page_map_canvas_fromAddress').value = add; document.getElementById('snear').value = add; } function errorHandler(err) { if(err.code == 1) { alert("Error: Access is denied!"); }else if( err.code == 2) { alert("Error: Position is unavailable!"); } } function getLocation(){ if(navigator.geolocation){ // timeout at 60000 milliseconds (60 seconds) var options = {timeout:60000}; navigator.geolocation.getCurrentPosition(showLocation, errorHandler, options); }else{ alert("Sorry, browser does not support geolocation!"); } } </script>
In the listing-filter-form.php file immediately before you added the new input form add
<input type="hidden" id="detail_page_map_canvas_fromAddress">
In geodirectory-functions > map-functions > map_template_tags.php
at around line 131 just before the button input add
<input type="button" class="geo" onclick="getLocation();">
If you want to can add a value to the input in the same way as you did with the search geo-locate.
Kevin
Hi Julian
Just seen your site and you have two search boxes now. You did not have to paste all the input code into the file you just had to add id=”snear” to the input field that was already there.
Kevin
At the moment directions do not work on Geodirectory
if you try and get directions to a location the directions go to your default location and not the actual attraction location.
As such until the fix is done it is pretty pointless giving you instructions on how to do it in case the developers change the inputs and id etc.
Kevin
Hi Julian,
My mistake I forget to say you need to set an id.
in the listing form filter file where you put the new input you will see immediately before another input with a class of snear you also need to add an id of snear – so it looks like
<input name="snear" class="snear" id="snear" type="text" value="<?php echo $near;?>" onblur="if (this.value == '') {this.value = '<?php echo NEAR_TEXT;?>';}" onfocus="if (this.value == '<?php echo NEAR_TEXT;?>') {this.value = '';}" />
It needs the id for the jquery to pass the value to the form field.
Sorry
Kevin
That’s pretty simple to do.
You should post a job request in the customisation section. It should not cost too much.
Kevin
Hi Julian
It needs to go in your header.php file but you can do this with the geodirectory settings page. Under design you have a tab for scripts. Just add the script to the header script code box.
Kevin
I think geolocation is probably standard for all things.
If you want the geolocation to take place automaticaaly just write up a function using onload to pre-populated the elementId.
Kevin
Hi Stroudsco
At the moment the plugin category archives is still calling the standard WordPress category description.
You can download my plugin CategoryTinymce from WordPress and that gives you tinymce and shortcode abilities to the default description box.
I stopped support for the free plugin at wp3.9 but the top description still works. It might be a suitable stop gap measure until this plugin is fixed and then you just need to cut and paste across.
Kevin
Hi Manilaboy,
It can probably be done easily but I would not advise it. Not everyone wants to search from where they are.
Where geo-location is concerned it is best to offer an option rather than force it. A bit like autoplaying of video and audio. Not a good user experience if they feel you are tracking them automatically.
Kevin
Hi
I don’t want to get too involved in offering support or solutions but if you want geolocation on search then you can do the following.
Add this code to the header – you can do that is geodirectory design options:
<?php global $goe_locate; if($goe_locate){echo $goe_locate;} ?> <script type="text/javascript"> function showLocation(position) { var latitude = position.coords.latitude; var longitude = position.coords.longitude; var add = latitude+','+longitude; document.getElementById('snear').value = add; } function errorHandler(err) { if(err.code == 1) { alert("Error: Access is denied!"); }else if( err.code == 2) { alert("Error: Position is unavailable!"); } } function getLocation(){ if(navigator.geolocation){ // timeout at 60000 milliseconds (60 seconds) var options = {timeout:60000}; navigator.geolocation.getCurrentPosition(showLocation, errorHandler, options); }else{ alert("Sorry, browser does not support geolocation!"); } } </script>
Then open up geodirectory-tempates > listing-filter-form.php and add at around line 46 just before the search button
<input type="button" class="geo" onclick="getLocation();" value="Find Me">
You can do basically the same with directions but the problem with directions is that the plugin currently uses the default location rather than the actual location.
You can see the geolocation hack at naturesites.co.uk
Kevin
-
AuthorPosts