• I am a new WordPress user, and want to use it as a CMS. Most of my pages are static, and I can see how to do that. I have some that require PHP logic, DB access, etc. From my reading so far I see 2 ways to create pages with logic. I wonder if WordPress has a recommended or preferred way:
    1. Create my own page template for specific pages; codex documents how to do that. The only thing I don’t like about this is if I switch templates, or update template, my page template might not work anymore.
    2. Write a plugin that looks for a shortcode on a page, and returns the web code to appear on the page. I like this way, but have not seen any discussion as to whether this is suggested, or has a downside.
    Thanks for any guidance on this.

Viewing 1 replies (of 1 total)
  • Frankly, I don’t think that there’s much between the two solutions and, in situations like this, WP doesn’t have a “preferred” approach. It’s really just down to what the individual site owner can (and wants to) do in terms of coding.

    If shortcodes suit your needs, then go for it.

Viewing 1 replies (of 1 total)
  • The topic ‘Recommended use of PHP in pages’ is closed to new replies.