It looks like you’re defining distance() in a template file. As @wongjin pointed out in the comments, a template file may be included multiple times, and so on the second inclusion PHP will try to redefine distance(), resulting in a fatal error.
Try moving the function distance(){ ... } code to a separate file that is then loaded by the template file (using, eg, require or something similar).
Related Posts:
- Matching Chapters to a Custom posts [closed]
- ACF: post query, hide duplicate values [closed]
- Redirect to another page using contact form 7? [closed]
- Using ACF default value to autoincrement a number field
- How do we update a custom file upload field with the Advanced Custom Field plugin?
- Preview with Custom Post Type Not Working
- How to create repeater field manually, without plugin (ACF Pro)?
- Setting Author on CPT
- Wrong block appender button showing
- Custom media upload content for inserting custom post shortcode
- Is it possible to define a template for a custom post type within a plugin independent of the active theme?
- Gutenberg disallow certain custom blocks but keep all core blocks?
- How to disable Gutenberg editor?
- Generate Advanced Custom Fields box in custom admin menu page
- Register Custom Post Type from Plugin
- List events by month
- Updating post meta for custom post types
- Template for custom post type shows all posts instead of just one
- Gutenberg: Difference between “import” and “const” for dependencies
- Difference between register_block_type & wp.blocks.registerBlockType
- Can I share predefined fonts from theme_support with a gutenberg component?
- How do I store information in a dynamic block in WordPress?
- How to create custom embed block in gutenberg wordpress
- Should i delete the posts created by a plugin on uninstall?
- Getting RGBA colour from gutenberg colourpicker
- How does WP handle multiple matching rewrite rules?
- Is it possible to use WordPress as an online portfolio for text content? What kind of theme would I look for?
- How can you include a theme template file from within a plugin (i.e. WooCommerce’s Shop page)?
- Correct way to make meta box with more than one meta field secure
- I want to extend the current themes’ single.php to display the meta fields of my CPT
- more types plugin – display all post of post type on page
- When using Simple Fields plugin, how do I pull the information out of the database to display on a page?
- Using a post-signup hook to get user details
- className not populating in custom block
- Using SVN to upload plugin created with gutenberg blocks
- Will Gutenberg Have a Negative Impact on Page Speed?
- dirname( __FILE__) returning wrong directory inside plugin
- Can’t get Gutenberg InspectorControls to work
- Advanced Custom Fields – Disable Users to Edit Custom Fields
- WordPress custom taxonomy not showing
- Gutenberg Block Style CSS Class Is Not Applying on Backend
- How to Resize the Custom Post Images?
- React error #231with Custom Blocks after upgrade to WP 5.5
- posts from multiple post types in one slider
- How to have a gallery in which each image’s caption is a whole “post”?
- Custom Post Type – custom form in dashboard
- ACF – How to set the menu order for the relationship field
- Translation to ACF relationship field
- Use jQuery Datepicker code from plugin
- Posts 2 Posts: Display custom types connected to the same other custom type but with another connection
- Including content from legacy app: via plugin or custom content?
- Dictionary-style definition list plugin
- Error Metabox Warning: call_user_func() expects parameter 1 to be a valid callback
- How can I disable an attribute from a Gutenberg block included in a template via InnerBlocks?
- Import Recent Posts Only and Ignore old ones if exist
- WordPress REST API: Query media files attached to a custom post type
- Gutenberg: Prevent links from being clickable in the block. Error: “Cannot destructure property ‘frameElement’ of ‘r’ as it is null.”
- acf backend error handling
- How to get the custom field value using SQL query
- @wordpress/scripts advanced usage
- How to display the category name in the tab and post inside the tab in WordPress?
- Want to build parent-child relationships between custom post types created with CPT UI
- Has blocks gutenberg block multiples registers type in my Plugin
- Possible way of having multiple Gutenberg instances for a page?
- custom post type plugin error [closed]
- Add an action based on custom post meta field
- Merging new theme and plugins from development site to production
- Ultimate Members Default Post Layout problem
- Images are broken in Wysiwyg Editor – ACF backend
- make p tag collapsed after 3 rows
- Gutenberg Block: How to reload a ServerSideRender?
- How do I change the functionality of an image slider which is part of ACF?
- Gutenberg editor in WordPress 5.0.3 /wp-json/wp/v2/pages/4713/autosaves?_locale=user 500 (Internal Server Error)
- Looping through image object using ACF and CPT UI [SOLVED]
- How to load custom post type plugin after acf options page (or get settings from there another way)?
- Calling an custom field from theme option at the frontend
- Making a Custom Post Type Publish Loop
- WordPress User Frontend Editing Custom Fields
- ACF: Hide a div or template section when a custom field (in a field group) is empty
- How ACF Advanced Custom Field works with Woocommerce Single Product [closed]
- Make a magic tag work with Custom Post Types
- Retrieve a post with its ACF repeater fields in wordpress
- True/False ACF field returning null by default even if default value is true
- How to export post tags from wordpress
- How to access the page without registering in wordpress
- CPT template is not being automatically used single post pages
- Set the title of a custom post automatically by using info from custom fields?
- ACF prugin for WooCommerce Shop Page
- Accessible ‘List Carousel’ block/pattern?
- public custom posts not showing in my wordpress plugin
- plugin translation *.mo file not getting loaded for custom post
- how to compare date meta value in jet smart filter Date query?
- Not applying update field (acf) in my plugin
- Plugin question, How to insert a colon in a value box
- My site has only one page, and users access my uploaded mp3 files from there – can I analyze access by song title?
- Tickera missing attendees – No attendees found
- How do I know if an archive correspond to a custom post type taxonomy?
- How to change the version of block.js and plugin to the same of Package.json?
- How do I apply different block supports to different parts of my custom block?
- Custom Gutenberg blocks not showing in WP editor