How to add block of editable text to wordpress homepage?
# December 3, 2012 at 6:20 pm
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:28 pm
To 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 7:16 pm
Hey 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 …
< ?php echo get_post_meta($post->ID, ‘key’, true)
…where I would like the description to appear.
Does that sound about right?
You must be logged in to reply to this topic.