WordPress.org

Ready to get started?Download WordPress

Forums

Help with custom page templates (4 posts)

  1. louiswalch
    Member
    Posted 2 years ago #

    New to WordPress, so bear with me. Trying to set a site up using WordPress more of a CMS. Everything on the site I am adding as a Page, and pasting HTML directly in to the editor.

    One section of my site is going to list biographies of people, and my client is going to be editing this regularly, so I want to it up as easy as possible to edit.

    Can I set a page parent up so that when you try to create a child page it will automatically show a set number of fields (e.g. Name, Age, Profile, Image, Position) instead of one large WYSIWYG editor?

    Thanks for the help.

  2. csleh
    Member
    Posted 2 years ago #

    First, putting the html directly into the Page content area is not a great idea, especially if a client is going to edit that at any time. That html can go right into the page template, which is conveniently called "Page Template" in the theme editor.

    Second, yes, you can set up a Page parent like you ask. For this approach, you could make a custom page template for the children -- BUT your client would have to remember to check off the correct page template choice. Then on that template you would call in the custom fields.

    The fields could be managed with generic custom fields, but I think that's confusing. A better option would be to install a plugin that manages that. There are lots out there with different options, and you can tell it whether or not to display the editor (the big area with wysiwyg).

    It can be scary editing template files at first, but it gets easier. Look at some videos, check out starter info on other websites (not the codex here). The best thing I learned was to first copy all the code from the template file and paste into a text file (not Word), then make my changes. If the page breaks you can always reload the first code. And be patient, the learning curve takes a little time.

    You might also consider making the biographies a category with posts. Then the posts in that category could be listed on the appropriate page. You would need to set up a custom template for those posts (including the code for custom fields) then edit the Page Template to get those. This would be an if/else statement: if is_page ('where-a-list-of-bios-would-go-page-title') show the list of posts in the category of biographies, else get on with the default page styling.

  3. louiswalch
    Member
    Posted 2 years ago #

    Thanks for the help.
    Do you have a recommendation for a plug to manage what shows up on the edit screen of a specific template type? You approach sound perfect.

  4. csleh
    Member
    Posted 2 years ago #

    This one is super simple:
    http://wordpress.org/extend/plugins/advanced-custom-fields/

    And this one is more configurable, but a little more confusing at first (I use it now and love it though):
    http://wordpress.org/extend/plugins/custom-field-template/

    I haven't used this one but it seems popular:
    http://wordpress.org/extend/plugins/more-fields/

    There are lots of choices. Remember to put the appropriate code in the template to display the values. Have fun!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.