auto generate pages (2 posts)

  1. mamulea
    Posted 5 years ago #

    Hello. I am developing a sport website that will have a "scores" section. There will be plenty competitions involved and I will need a separate page for each day of a specific competition. To fully understand, lets say I will have a Premier League page and a Serie A page, each one having 38 subpages corresponding to the 38 days. The permalink of these pages will be something like example.com/premierleague/day1, example.com/premierleague/day2, ... example.com/premierleague/day38, examplecom/seriea/day1, example.com/seriea/day2 and so on.

    Obviously, I will use a template to display the scores on each one of these pages. Now the question is: is there a way of creating all these pages (there will be hundreds of them) other that manually creating them in the Page section in admin?

  2. christian_gnoth
    Posted 5 years ago #

    you can create a plugin with an admin panel - there you can offer different options and input fields and with a button you can create the pages - wp_insert_post() creates pages, post_type='page'.

    if you assign different categories (premierleague, seriea etc.) to the pages with the wp_insert_call you can create for each category a template file.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.