WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] how can I make my static content editable from dashboard (5 posts)

  1. preitybansal
    Member
    Posted 1 year ago #

    Hi, I am customizing a theme and have created a division on homepage which will hold some static content. The content at present time is written in php file inside that division. But I want that content to be editable form wp-dashboard either through a post or a custom field.
    Any idea how to achieve this.

    Thank you

    Regards
    Preity

  2. esmi
    Forum Moderator
    Posted 1 year ago #

    Perhaps you need to review creating a static front page?

  3. preitybansal
    Member
    Posted 1 year ago #

    Hi,
    I tried something like this

    <?php
    $my_id = 33;
    $post_id_1 = get_post($my_id);
    $content = $post_id_1->post_content;
    echo $content;
    ?>

    It works perfectly fine but now as it is a post it appears with other posts also.
    I want to exclude it from appearing anywhere else.
    I know using wp_query but dont know the exact code where to write in index.php.

    Any help?

  4. Rev. Voodoo
    Volunteer Moderator
    Posted 1 year ago #

    Two simple options I can think of...

    You can register a new sidebar (widget area) and place it there, then just use a text widget in that area to fill in what you want
    http://vudu.me/sidebar has an overview of that concept

    Or, you can run a loop there, and have it query one specific page/post which you continually edit with whatever you want in that area
    http://codex.wordpress.org/The_Loop

    EDIT -- You guys were quicker.. carry on!

  5. preitybansal
    Member
    Posted 1 year ago #

    @Rev. Voodoo

    I have done the second way.. and it is done now.

    Thank you.

Topic Closed

This topic has been closed to new replies.

About this Topic