Ask your WordPress questions! Pay money and get answers fast! (more info)

building a one page WordPress site WordPress


What is the best way to build a one page wordpress site? I am trying to make one but am running into trouble everywhere.

This is the site mostly coded into wordpress

check out the blog and you can see what issues I am having. I have to reload the page to get the content from single.php. I can't figure out how to get it without the refresh. I was thinking that I could delete single.php and page.php and the index.php would handle all the posts but I don't see how to get the full content from single.php. I have a custom walker that runs the nav that ads #! to the navigation. I would like to get rid of that. Is there a filter that can grab the nav after the button is clicked so that I can say that if it is a single page, do nothing but if it is home add in the #!

Answers (3)


Plugarized answers:

Well, I suggest looking in your blog's template for

<?php the_excerpt(); ?>

and change it to

<?php the_content(); ?>;

Jamie comments:

that isn't going to work in this situation. This isn't an issue between the excerpt or content


Francisco Javier Carazo Gil answers:


You can change your index.php to make that it only load one page defined in dashboard, something like this:

$your_query = new WP_Query( 'pagename=about' );
// "loop" through query (even though it's just one page)
while ( $your_query->have_posts() ) : $your_query->the_post();
// reset post data (important!)

Jamie comments:

I understand your idea here but this isn't the approach I am looking for. I am not trying to load one page into the homepage. I am trying to load every page into the homepage. So I created a loop that uses get_pages() and tests for meta_value of wp_page_templates and gets those pages. That takes care of getting all the page templates. Now I am trying to get the content of a single page. Like when you click on the_permalink() to get the full article of a blog post. Right now it resfreshes the site to get the page but because of my nav walker, this is causing problems.


Marko Nikolic answers:


if I am right, the best solution for you would be to "ajaxify" your theme. Check [[LINK href=""]]this tutorial[[/LINK]] or try [[LINK href=""]]this plugin[[/LINK]].

That should allow you to load pages/posts without refreshing whole page, but only the part you want.

Jamie comments:

I have tried ajax and found that when the content is loaded with ajax, my scrollbar won't work. I am trying to find a non ajax solution to this problem.