• I have a Page that’s a parent page of 2 other pages. I’d like to show a snippet, or the whole child pages content on the parent page.

    Does anyone know what the codex is for displaying a specific pages content on another page?

    I’m also looking to use this codex to display a page’s content without making specific templates, because I’ll be using an e-commerce software, but also be using WordPress as my CMS. So I’ll be entering the codex in the e-commerce page, but once there, I’ll be updating the content through WordPress. Using WordPress makes it easier to update content on the fly, then through my e-commerce software, since I have to be logged on to my server.

Viewing 6 replies - 16 through 21 (of 21 total)
  • Inserting the shortcut in the main content pane of the page loaded the other page’s content. But it outputted that 2nd page’s content before the content of the page itself. Even though I placed the shortcode after all of the content. Is there a way to render the page content before the shortcode? That is to have the content targeted by the shortcode appear where the shortcut is places (rather than first).

    c0mp

    (@c0mp)

    Hello everybody.
    @gabrielcastillo, thanks for your snippet. It works but not perfectly. I have the same problems as russcoon.

    I use the shortcode within another shortcode (tables, accordion,…) and within normal html code.

    Although I putted your shortcode hierarchically underneath these elements, it appears above.
    Do you have an idea to fix this? Thanks.

    strakez

    (@strakez)

    @c0mp, you need to return the values as a statement at the end of the function. Right now the values are outputted as the function runs. I believe something like this should do the trick:

    <? $the_query = new WP_Query( 'page_id=149' );
    $output = "";
    while ( $the_query->have_posts() ) :
    $the_query->the_post();
    $output .= get_the_title();
    $output .= get_the_content();
    endwhile;
    wp_reset_postdata();
    return $output;
    ?>

    Now the values are caught by the “output” variable and gets outputted where you place the shortcode.

    strakez

    (@strakez)

    FYI, the code in my previous post is intended within the scope of @gabrielcastillo’s shortcode function

    @ gabrielcastillo

    you are a genius ?? thanks ?? worked perfectly after searching for 3 days this done the job for me

    Thank a million

    Thanks guys that has been really helpful. what would be the php code to put in footer page by example, I’ve tried that different variations of codes but it doesn’t work… the [my_content id=”33″ title=false/] didn’t work either though it works well when I paste it on a page.

    I’ve tried that without success:

    <div id=”footer”>
    <?php get_post_page_content (my_content id=”33″, title=false) ?>
    </div>

Viewing 6 replies - 16 through 21 (of 21 total)
  • The topic ‘Showing one page's content on another page’ is closed to new replies.