Linux 软件免费装

Wordpress Post Distance Filter

开发者 niksudan
更新时间 2015年3月5日 22:36
版权: GPLv2 or later
版权网址: 版权信息

标签

posts location filter archive distance

下载

详情介绍:

Filter posts by distance from a specified location. This plugin implements simplistic functionality to WordPress posts by enabling archives to be sorted via distances from a specified location when certain URL parameters are detected. You are able to show how far the post's distance is, and restrict results by a certain radius. Supports various units of measurement and is customisable too. Examples of use could be a job search or a store locator.

安装:

Setup Upload the wp-post-distance-filter folder to your plugins directory, then activate the plugin in the Plugins menu. An option should appear under Settings. Changing Options On the options page you'll have a few settings that you can change to make the plugin work to your liking. Specifying Post Locations To make a post able to be filtered, you must specify the location using a custom field. Enable this at the top of the page. Then enter the name of your location meta_key and specify the value you want it to show. After updating the post, two more custom fields should appear - the lat and lng keys if done correctly. Filtering Posts For any archive page, if the URL location parameter is specified, it will order by distance. You can limit the number of results using the URL radius parameter. You can show distance information using the_distance(); and get_the_distance(); within the wordpress loop. if (have_posts()) : while (have_posts()) : the_post(); the_title(); the_content(); the_distance(); endwhile; endif;

常见问题:

My posts aren't filtering

Make sure that your URL parameters are correct and the plugin is enabled.

The latitude and longitude aren't calculating

Make sure nothing else is using the post's lat and lng meta_keys. If they are, consider changing their names on the options page.

My posts's aren't showing up

Make sure that you've specified a location

I can't see the custom field for location

You need to enable the custom field option by clicking the post dropdown at the very top of the page.

更新日志:

1.1.1 1.1.0 1.0.1 1.0