WordPress Geo Mashup-自动向帖子添加地图的插件

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了WordPress Geo Mashup-自动向帖子添加地图的插件相关的知识,希望对你有一定的参考价值。

The awesome Geo Mashup Plugin for WordPress allows for auto-embedding a map showing the location of the Post, Page etc via Shortcode or adding a line of php into the Theme file/s.

The code below, added as a Plugin, will make a map appear at the end of each Post when a Post has Geo data (i.e. will automatically show on Posts when Geo data is defined in the Post).

To use:
1. Save the code below in a file called geo-map-end-post.php
2. Add the file to the /wp-content/plugins directory on your Webhost
3. Activate the new Plugin
  1. <?php
  2. /*
  3. Plugin Name: Geo Map to end of Post
  4. Plugin URI: http://everyaustralia.com/map-of-photos/
  5. Description: Adds a Map to the end of each Post showing the location per the Geo Mashup Plugin.
  6. Version: 1.00
  7. Author: Gary Eckstein
  8. Author URI: http://eckstein.id.au
  9. License: GPL version 3
  10. */
  11. add_filter('the_content','end_post_content');
  12. function end_post_content($content) {
  13. if (is_single()){
  14. $content=$content.GeoMashup::map();
  15. }
  16. return $content;
  17. }
  18. ?>

以上是关于WordPress Geo Mashup-自动向帖子添加地图的插件的主要内容,如果未能解决你的问题,请参考以下文章

PHP WordPress Geo Mashup - 自动添加地图到帖子的插件

PHP Geo Mashup当前类别的全球地图

如何加快 WordPress 中的 GEO 搜索

php facetwp index geo my wordpress latitude / longitute

从WP-Geo-WordPress插件中删除CSSJS和/或仪表板小部件

Wordpress ACF 显示关系问题