Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

WordPress From Bootstrap to WordPress Create Bootstrap Styled Theme Templates Creating a Full Width Static Page Template

David Jørgensen
David Jørgensen
4,668 Points

From Bootstrap to Wordpress - one-page option

I'm using Zac's guide to convert an existing Bootstrap 3 one-page framework (Stylish Portfolio) for use on Wordpress. Doing OK so far, but having a mind freeze about how to connect individual pages to each div section. Using if ( have_posts() will output the contents of the most recent post to whatever div section I include that code inside, but that's obviously not what I want. I know the answer will be very simple, but I just can't work it out...

2 Answers

David Jørgensen
David Jørgensen
4,668 Points

Thanks Damir - actually found my solution with this code:


$page_id = 85;

$page_data = get_page( $page_id );

$excerpt = apply_filters('the_excerpt', $page_data->post_content);

$title = $page_data->post_title;

$permalink = get_permalink($page_id);

echo $excerpt . '<br/>'; ?>