Parks Custom Post Type Plugin

Version: 1.0

Author: Rustamveer Singh
Description: A simple plugin which adds a custom post type for Parks.
Demo URL: https://bcaur.com/list-park/

Click Here to Download ZIP


Installation Instructions

Prerequisites

  • A working WordPress installation (minimum version 6.0).
  • Recommended PHP version 7.4 or higher.

Steps to Install

  1. Download the Plugin: Obtain the plugin as a .zip file.
  2. Upload via WordPress Admin:
    • Go to Plugins > Add New in the WordPress admin panel.
    • Click on Upload Plugin, select the .zip file, and click Install Now.
    • After installation, click Activate to enable the plugin.
  3. Upload via FTP (Optional):
    • Extract the .zip file to your computer.
    • Use an FTP client to upload the extracted folder to the wp-content/plugins/ directory.
    • Go to Plugins in the admin panel and activate the plugin.

Features

  • Custom Post Type:
    Add and manage parks with the Park post type.
  • Custom Taxonomy:
    Categorize parks using the Facility taxonomy.
  • Meta Boxes:
    Add custom details like location, hours, and a short description for each park.
  • Shortcode:
[park_list]
  • AJAX-Based Filtering:
    Dynamically filter parks by facilities without reloading the page.

Usage

Displaying Parks

Add the shortcode to any page or post to display a list of parks.

[park_list]

Filtering Parks

  • Visit the page with the shortcode and use the dropdown menu to filter parks by facilities.

Troubleshooting

Parks Not Displaying:

Ensure the shortcode is added to the page or post.

[park_list]

Confirm that there are published parks in the Parks post type.

Filtering Not Working:

Check that permalinks are configured in Settings > Permalinks.

Verify AJAX requests using your browser’s developer tools.

Styling Issues:

Ensure the plugin’s stylesheet (parks-styles.css) is loading correctly.

Js Issues:

Ensure the plugin’s js file (parks-ajax.js) is loading correctly. Js file is essential for the filters to work.


Additional Notes

Directory Structure

  • Assets: Contains styles and js for the parks list (parks-styles.css & parks-ajax.js).
  • Templates: Includes the custom single park template (single-park.php).
  • Main Plugin File: parks-custom-post-type.php.

Hooks and Filters

  • AJAX hooks:
    • wp_ajax_filter_parks
    • wp_ajax_nopriv_filter_parks