How to add block of editable text to wordpress homepage?

Bit of a wordpress amateur here.

I am creating a theme. On the home page there will be 2 sections…

Read More
  1. Latest post excerpt (I know how to do this!)

  2. 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

Related posts

Leave a Reply

2 comments

  1. Quick and dirty..

    <?php
    $content = get_posts(array('post_type'=>'page'));
    foreach ($content as $post):
        if ($post->ID == 6) {
            setup_postdata($post);
            the_content();
        }
    endforeach;
    ?>
    

    Replace 6 with the ID of your About page. It’s not an elegant solution, but it’ll do the job.

  2. Here you have used the best plugin ever in WordPress Advance Custom fields plugin:

    http://wordpress.org/extend/plugins/advanced-custom-fields/screenshots/

    Install in your WordPress site.

    Create a group for specific page.

    Here you can create a specific block for specific page like home page, About us Page etc from admin side.

    AND

    Get this value in home page and display it.

    Note: Please read the description and see the screen shot of this plugin