• Hey everyone!

    Some help here would be appreciated. I have a website I just made for a client. https://www.guidalings.com

    If you visit my site, you see I have an accordian style navigation menu. I have wordpress already integrated into the blog category.

    I’d like to have the content under Other tabs(welcome, goods, about, contact) editable in WordPress as well. I thought this was done using pages, but I am at a loss for whatever code needs to be added into my current index.php to accomplish this.

Viewing 12 replies - 1 through 12 (of 12 total)
  • Thread Starter ChelleDeAnne

    (@chelledeanne)

    Quick note: My site is a single page site, I do not reach out to other links, instead i am just expanding and collapsing content.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Can you use get_post and just pass in the ID of the post/ page?

    Thread Starter ChelleDeAnne

    (@chelledeanne)

    Okay This isn’t working, but maybe I doing this wrong. Here is my html code with the get post command I’m trying.

    <div class="content-parent">
    <p>1</P>
    
    <?php
    $post_15 = get_post(15, ARRAY_A);
    $title = $post_15['post_title'];
    ?> 
    
    <p>2</P>
    <p>3</P>
    </div>

    Am I doing something wrong here. It just shows up blank on my site

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    what is ARRAY_A?

    Thread Starter ChelleDeAnne

    (@chelledeanne)

    I don’t know I got it off Get_post codex link example

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Oh okay.

    That code you posted will output:

    <div class="content-parent">
    <p>1</P>
    <p>2</P>
    <p>3</P>
    </div>

    Is that what you are getting?

    Thread Starter ChelleDeAnne

    (@chelledeanne)

    Yes,

    I have the 1, 2, 3 there because I was trying different get posts methods.

    I still cannot get the data from my pages to display.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Did you forget to echo out $title?

    Thread Starter ChelleDeAnne

    (@chelledeanne)

    How do I do this?

    My page is id 15

    The name of the page is About The Bakery

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    <div class="content-parent">
    <p>1</P>
    
    <?php
    $post_15 = get_post(15, ARRAY_A);
    $title = $post_15['post_title'];
    
    echo $title;
    ?>
    
    <p>2</P>
    <p>3</P>
    </div>
    Thread Starter ChelleDeAnne

    (@chelledeanne)

    Hell Yes, So this returned The title of the page!

    Now how do I return the content on it

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Look inside your $post_15 variable to see what other treasures it has. At the moment you’re only getting the post_title from that variable.

    E.g:

    print_r($post_15);

    https://uk3.php.net/print_r

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Help! I am trying to integrate pages into my single page site.’ is closed to new replies.