0

I'm pretty experienced in development in general, and also did some PHP coding to generate hmtl pages. I've also got a running WordPress blog with a number of posts.

As a start, I want to "generate" the index page (the first page the user sees when coming to my domain). I can probably code that in PHP, but I'm not sure where to "put" this PHP code within my WordPress site. (I want to re-use the general design of the site.) Later, I want to have other "types" of pages that I generate in code (e.g. a user form and - based on the input - generated result pages).

Probably a totally noob question ;-) but I'd appreciate any pointers (also blogposts, books etc.). Thanks!

4
  • 3
    I'm not totally sure what you are aiming for, but if it is about a home/frontpage you probably should take a look at: codex.wordpress.org/Template_Hierarchy Commented Jun 2, 2013 at 21:12
  • The "frontpage" is just a first step. Basically I'd like to have a simple web app (custom search and results pages) inside my WordPress site ("normal" posts). Hope this helps ...
    – IronGoofy
    Commented Jun 2, 2013 at 21:15
  • 1
    Sorry, that comment ^^ is more confusing than the question.
    – s_ha_dum
    Commented Jun 2, 2013 at 22:04
  • I'm sorry - my problem here is that I can't find the right question to ask. I edited my question, hopefully making the purpose a bit clearer.
    – IronGoofy
    Commented Jun 3, 2013 at 5:23

1 Answer 1

1

It sounds like you just want a custom index page for your Wordpress site. In that case, create a new page in the site (/wp-admin/post-new.php?post_type=page). Then create a home page template file and assign it to the newly created page (the custom template assignment is in the Page Attributes widget on the edit page).

Finally, configure Wordpress to use the new page as the home page, rather than the default latest posts list (assign here: /wp-admin/options-reading.php). Note that doing this will also remove any entry point for viewing the newest posts by date, but you can also assign a page for that on the reading options config (and assign the appropriate template file to it).

This custom home page template file may contain anything you'd like, but it will also execute within the standard Wordpress environment so you can use the entire WP API when rendering.

The location for this code is in the folder of whatever Wordpress template you happen to be using (/wp-content/themes/...theme name...).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.