• Hi, I’m trying to get an entire pages content to appear in a slider. I’ve got it working on a standard page with the below code. But when I try this it on a page with posts it doesn’t work. I want it to appear in the slider exactly as it would as a normally. Any help would be great. Cheers

    <?php
    $id=83;
    $post = get_page($id);
    $content = apply_filters(‘the_content’, $post->post_content);
    echo $content;
    ?>

Viewing 5 replies - 1 through 5 (of 5 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    What do you mean, “it doesn’t work”?

    Is this regarding a particular plugin or theme?

    Thread Starter eckul

    (@eckul)

    Hi, I don’t think it has anything to do with the theme or a plugin. I basically just want to get a page and place it’s content within a template file, So everytime I use that template it will include that pages information. There is probably a better way of doing it. It just wont grab a page that has posts for some reason. Do I need to add get_posts or something similar to my php? I can’t seem to find the answer.

    What theme are you using? Where did you download it from?

    Thread Starter eckul

    (@eckul)

    Hi, I’m using a theme called Twins which I downloaded from theme forest it’s by template square, it’s a really good theme, I’ve been customizing a bit . Do you think it’s theme related issue? maybe I should contact their support?

    Thread Starter eckul

    (@eckul)

    I’ve managed to get it working by putting royal slider in a page template and posting the below code into the slider. I haven’t done a lot of testing yet but seems to be fine at this stage. Could be a messy way of doing it, but the only solution I’ve found so far.

    <?php
    $custom = get_post_custom( get_the_ID() );
    $cat = ( isset($custom[‘ts_blog_category’][0]) )? $custom[‘ts_blog_category’][0] : “”;
    global $more; $more = 0; $post;
    $args = array(
    ‘post_type’ => ‘post’,
    ‘paged’ => $paged
    );
    if($cat!=””){
    $args[‘cat’] = $cat;
    }

    query_posts( ‘cat=2’ );

    rewind_posts();

    get_template_part( ‘loop’, ‘archive’ );

    wp_reset_query();
    ?>

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘echoing entire page content including all posts from that page.’ is closed to new replies.