• I have an online store, and basically have thousands of pages ranging from specific product pages to product list pages. I need some help understanding the proper way to add all these pages to wordpress.

    To date, the way I’ve handled all these pages is by using hooks for things like status_header and template_redirect. It would be extremely inefficient to go and define a wordpress page for every single page on my site.

    My flow looks like this:

    (1) an incoming request for a page comes in, and the page is not defined in wordpress.
    (2) status_header is called with my hook, and my hook checks the URL for validity and, if the URL matches a regexp, it sets a global variable to define the page type and forces an ignore of is_404(). Otherwise, the page would have thrown a 404.
    (3) template_redirect is called, as again, this isn’t a valid wordpress page, despite the fact that I force the ignore of the 404. At this point, my template_redirect hook loads the appropriate template page (i.e. page.php) and then exits gracefully with an exit(0).

    This is very much a hack. There has to be a better way to handle this. I haven’t been able to find anything about creating large numbers of dynamic pages like this.

    I think I have the wrong concept when it comes to handling these types of pages in wordpress, so I could really use some pointers.

    Thanks,
    Dustin

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter dustin999

    (@dustin999)

    FYI, I’m using 2.8.4.

    Thread Starter dustin999

    (@dustin999)

    Thanks.

    I’m in the same boat, a client of mine went and built their site on WordPress, now they actually need CMS functionality I’m struggling to build it on.

    WordPress is fine as a Blogging tool, but it’s lacking the modular approach of something like Drupal, where every page request is routed through a front-controller and modules have the ability of implementing a menu hook. See: https://api.drupal.org/api/group/menu/6

    Honestly, I’m thinking that the problem is just my ignorance, but if that is the case I can’t find anything in the documentation that shows the right way to route page requests.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘proper way to add dynamic, db-driven content’ is closed to new replies.