Dynamic content in a static page

You do want static pages. The easiest way to do this, and a very good way even if perhaps not the only way, is:

  1. Create one or more custom template files for your static pages. This is where your PHP comes in.

    /*
    Template Name: Calculator
    */
    get_header();
    
    // your calculator code 
    // Whatever PHP you have should work
    
    // This is very minimal. You may want something more complicated. 
    
    get_footer();
    
  2. Save the file as some name not on the reserved list

  3. Create your static pages from wp_admin->Pages. Why creating the pages, save them with appropriate “Template”– that is, one of the ones you’ve created. (Look in the right sidebar under “Page Attributes”.)

This way, you can keep the calculator pages consistent with the other pages on the site.

Leave a Comment

error code: 523