Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End How to add block of editable text to wordpress homepage?

  • This topic is empty.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #41136
    croydon86
    Participant

    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

    #116201
    chrisburton
    Participant

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

    #116202
    Watson90
    Member

    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.

    #116204
    chrisburton
    Participant
    #116207
    Watson90
    Member

    @chrisburton, ignore what I said above. I originally misread the original question. Custom fields are a good idea, I should know haha!

    #116209
    chrisburton
    Participant

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

    #116216
    croydon86
    Participant

    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 …

    ID, ‘key’, true)

    …where I would like the description to appear.

    Does that sound about right?

    #116218
    chrisburton
    Participant

    @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

    #116322
    croydon86
    Participant

    @chrisburton thanks a lot for your help. I really appreciate it.

    This seems to have done the trick!

    #116323
    chrisburton
    Participant

    Glad to hear. Let us know if you have any further questions.

Viewing 10 posts - 1 through 10 (of 10 total)
  • The forum ‘Back End’ is closed to new topics and replies.