James Barlow
Forum Replies Created
-
A lot of older themes are getting caught out by issues like this. If you’re not seeing the popup on your site after upgrading to WordPress 4.5, check out the console message and look for the error message (example from an old site):
jquery.js?ver=1.12.3:2 Uncaught Error: Syntax error, unrecognized expression: a[href=#top]It’s probably a syntax error similar to
a[href=#top], an attribute selector which is not an identifier or string. That is, there are no quotation marks around the value.So dig around in your theme for
a[href=something]and change it toa[href='something']and you’re probably good to go.Just tried it again; it was a SASS-style single line comment causing the problem. Which is fair enough as those aren’t in the css spec.
// Single-line comment without SASS preprocessing breaks the next media query @media all { .something {color: red;} }Forum: Plugins
In reply to: [WP Geo] Gravity Forms with WP-Geo 3.3WP Geo adds two custom fields to a post that contain latitude and longitude values (numbers).
The goal with this bit of code is to display a map on the form page, use some jQuery to extract the latitude and longitude of a marker from the Google Map object whenever those values change, and make a Gravity Form that has two text input boxes that save the data with the correct custom field names for WP Geo, which are _wp_geo_longitude and _wp_geo_latitude
So, whenever a user interacts with the map, we get the lat/long values, and stuff those into the correct input fields on the Gravity Form [which don’t need to be visible] and then when the submit form button is pressed you’re done.
There are two bits in the code:
1) Add Filter statement
add_filter(“gform_pre_render_1”, “gravityforms_map”);
The _1 at the end of gform_pre_render targets the gravity form with ID #1
2) The function actually modifying the form
function gravityforms_map($form) {…}The jquery bits that are added to the page by this filter are acting on specific fields in the gravity form. In the example code, there are references to #input_1_4, #input_1_5 and which are the field IDs of the fourth and fifth fields in the form with ID 1.
As long as you’re saving a post with those two custom fields – _wp_geo_longitude and _wp_geo_latitude – WP Geo does the rest.
Forum: Plugins
In reply to: [WP Geo] Gravity Forms with WP-Geo 3.3If you’re using the GF address field type, that does provide a link to a Google Map in the recorded entry, based on the entered address.
Gravity Forms isn’t necessarily the right tool for all cases though; if your user experience needs something more complex than the default GF fields, then although you could write something as an add-on for GF it might be worth trying something with a custom post type (WP-Types or Custom Press plugins can do the job without coding). Allow site users to create content of that type, and you could use the standard wordpress content editing interface, where WP-Geo adds a really nice tool for address/marker/coordinate entry.
Forum: Plugins
In reply to: [WP Geo] WP Geo with Google Maps v3 – Please help by testing…For Gravity Forms, I’ve hacked out the code below based on the previous technique to add a map to a form. This bit doesn’t actually use WP-Geo methods, but does rely on WP-Geo having correctly sorted out Google Maps API access. The result is correctly stored as a GForms entry, and as a post if you add in the required custom fields.
This is not recommended for production sites, though, and it would probably be better to do it as enqueued javascript. But it works on my machine(tm).
Forum: Plugins
In reply to: [WP Geo] Enable Mouse Wheel ScrollYeah, looks like mouse wheel scrolling is turned on by default in the new API. All looking good.