Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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:

<?php

$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/>'; ?>