- This topic is empty.
-
AuthorPosts
-
December 3, 2012 at 6:20 pm #41136croydon86Participant
Hi guys
Bit of a wordpress amateur here.
I am creating a theme. On the home page there will be 2 sections…
Latest post excerpt (I know how to do this!)
An ‘About us’ section – paragraph of text which I would like the client to be able to edit in the admin section, so not hard-coded. How can I create the code for this?
I am thinking of creating a page in the admin, then use PHP includes on the home page to display that page, but I don’t think this is the best way.
Any help would be great.
Thanks
December 3, 2012 at 6:27 pm #116201chrisburtonParticipantEither a custom post type ‘about’ and the client can input their text via the text editor or by using custom fields which you can add to certain sections (or all) of the backend.
December 3, 2012 at 6:28 pm #116202Watson90MemberTo do this you should just style the page.php file with your wrapper or however you are setting you website up. That’s what WordPre uses to set up individual pages such as an about page, contact page. Where as the blog uses the index.php file, and the single blog post uses the single.php file.
EDIT: sorry I misread the question. +1 on @chrisburton’s comment.
December 3, 2012 at 6:30 pm #116204chrisburtonParticipant@Watson90 Huh?
December 3, 2012 at 6:33 pm #116207Watson90Member@chrisburton, ignore what I said above. I originally misread the original question. Custom fields are a good idea, I should know haha!
December 3, 2012 at 6:36 pm #116209chrisburtonParticipantHa. No problem. I would probably setup a custom page rather than a custom post type now that I think about it. And in the backend I would have a custom field for the description. However, it really depends on the design.
December 3, 2012 at 7:16 pm #116216croydon86ParticipantHey thanks for the quick responses.
So Chrisburton, just to confirm…
1. I currently have a page set up called ‘Home’ in the admin.
2. On this page add a custom field for the description.
3. In my front-page.php file, add a snippet such as …ID, ‘key’, true)
…where I would like the description to appear.
Does that sound about right?
December 3, 2012 at 7:22 pm #116218chrisburtonParticipant@croydon86 Yes, exactly. I use the ‘More Fields’ plugin for my custom fields which is super simple but some like ‘Advanced Custom Fields’.
Here is a screenshot of my backend. http://cloud.chrisburton.me/LDgp
December 4, 2012 at 3:34 pm #116322croydon86Participant@chrisburton thanks a lot for your help. I really appreciate it.
This seems to have done the trick!
December 4, 2012 at 3:46 pm #116323chrisburtonParticipantGlad to hear. Let us know if you have any further questions.
-
AuthorPosts
- The forum ‘Back End’ is closed to new topics and replies.