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

building a one page WordPress site WordPress

  • REFUNDED

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

http://www.rc-hc.com/mafloral

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)

2013-02-21

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

2013-02-21

Francisco Javier Carazo Gil answers:

Hi,

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();
the_content();
endwhile;
// reset post data (important!)
wp_reset_postdata();


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.

2013-02-21

Marko Nikolic answers:

Hello,

if I am right, the best solution for you would be to "ajaxify" your theme. Check [[LINK href="http://www.deluxeblogtips.com/2010/05/how-to-ajaxify-wordpress-theme.html"]]this tutorial[[/LINK]] or try [[LINK href="http://wordpress.org/extend/plugins/ajaxify-wordpress-site/"]]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.