0

I'm trying to achieve something that I think should be fairly easy, but somehow I'm stuck.

I have created the css and html for a number of static pages and a blog section and now I want to turn it into a wordpress theme, but I only want the /blog section of the intended site to use the Wordpress loop for the blogposts. All the other pages are static, but obviously use the same header.php and footer.php, which I can just utilise by using require in those pages, but as an example, I'd like to link to /about rather about.php in my navigation, so I want it to go through Wordpress.

Does it make sense?

Thanks.

0

You could create page templates within the theme. So, for example, for your About page:

  • Create a "page-about.php" file in your theme
  • Include the content there, but instead of using require use the normal WP functions (i.e. wp_head()) so all your plugins' scripts and styles will load properly
  • Create a Page in wp-admin with the slug "about". You'll want to include a title (About) but you don't need to include anything else there, unless you want to put a little reminder in the main content editing area "The contents of this page are controlled by the theme" so if anyone looks later they'll realize content pasted here will never show up on the page

This will give you actual Pages in WP, which not only enables pretty permalinks (/about/) like you're asking for, but also other functionality - like sitemap generators including these "static" pages. You may eventually find it might be easier to manage these pages' content in wp-admin itself, in which case you can simply remove your custom template (page-about.php) and paste your content into the main editor.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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