Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9083161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T20:42:59+00:00 2026-06-16T20:42:59+00:00

I am creating my first wordpress plugin. In it, the user will have the

  • 0

I am creating my first wordpress plugin. In it, the user will have the option to add new cities and view events on those cities.

My client requirement is that the URL must be like this

SITE_NAME/cities/NY

or

SITE_NAME/cities/Califonia

What is decided is that i will create a folder cities and If user tries to create a new city i will create a file in that folder with that city, Further more I will add the entry into the database as well.I will insert PHP code into the file as well.

Being new to WP plugins. Is my approach right (for creating files)? Is there any other way?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T20:43:00+00:00Added an answer on June 16, 2026 at 8:43 pm

    maiorano84 wrote a fairly comprehensive guide to setting up the stuff you need, Rather than relying on plugins though, I prefer to show you how to write a plugin to register the custom post type and taxonomy. To that effect, I wrote a little plugin that should do everything you need and it has plenty of comments and links to the docs so that you can understand the Why of things.

    Code

    https://github.com/fyaconiello/WP_Cities_Events

    This plugin does several things

    1. Creates a custom post type Event
    2. Creates a custom taxonomy City
    3. Adds custom metaboxes to Event
    4. Adds City taxonomy to Event

    This plugin does not require any additional plugins to be installed, it is dependency free and only uses WP core.

    URLS

    As far as getting the correct URL Structure, I would suggest you read this thoroughly: http://codex.wordpress.org/Using_Permalinks.

    I do not understand the structure you want

    CITY is a single term w/i the taxonomy *cities*
    EVENT is the post single
    
    1. SITE_URL/cities/CITY would yield a page of all EVENT posts in that CITY
    2. you need a url like: SITE_URL/cities/CITY/EVENT to read a specific event in a specific city

    EDIT on how to urls:

    In your Settings -> Permalinks administration panel select: "Post name" and save.

    Screenshot

    Then, go to your Ce Events -> Cities admin screen.

    screenshot 2

    hover over one of your terms (in my case new york city) and click view.

    screenshot 3

    it should open up that term(city)’s list view and the url structure looks like so: http://wp.local/city/new-york-city/

    if you need city to read cities, modify line 102 of the main plugin file i shared with you:

    'rewrite' => array('slug' => 'city'),
    

    EDIT 2

    test event is not part of city it is a post categorized by city

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating my first wordpress plugin. one of the questions i have is
I'm creating my first android app that will make use of SQlite. I have
I am creating my first plugin and have a single function that controls the
I'm creating my first application and I have a window consisting of multiple subclasses
I am creating my first (!) database, and I have run into an issue
I am creating my first site in asp.net MVC and I have a very
I'm creating my first real binary parser (a tiff reader) and have a question
I have been creating a WordPress theme and have got a bit stuck with
i am creating a related post article feature for my wordpress enabled site.being new
This is my first wordpress site. I am creating a local community site and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.