Andrea Posted February 17, 2010 Report Share Posted February 17, 2010 I've just spent the last 5 days wrestling with trying to move a Wordpress site from one hosting account's subfolder to the primary folder in a new hosting account - NOTHING worked as expected. Now, the basics seem to have fallen in place, but on my index page www.aandbwebdesign.com, I get this error: Warning: Missing argument 1 for get_post(), called in /hermes/bosweb/web080/b807/ipg.aandbwebdesign/wp-content/themes/aAndbWebDesign/page.php on line 4 and defined in /hermes/bosweb/web080/b807/ipg.aandbwebdesign/wp-includes/post.php on line 241 no idea why this is, the theme is exactly as it was on the with the other host. This is page.php <?php get_header(); ?> <?php if (is_page('Home')) : ?> <?php $post = get_post(); echo $post ->post_content; ?> <?php else: ?> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <?php the_content('Read More ....'); ?> <?php endwhile; ?> <?php next_posts_link('< Older Entries'); ?> <?php previous_posts_link('Newer Entries >'); ?> <?php else : ?> Not Found … and you still haven't found what you're looking for (sing it, Baby) <?php endif; ?> <?php endif; ?> <?php if (is_page('Home')) : ?> <? endif; ?> <?php get_sidebar();?> <?php get_footer(); ?> I have no clue. Quote Link to comment Share on other sites More sharing options...
newseed Posted February 17, 2010 Report Share Posted February 17, 2010 (edited) I saw this problem a few years ago but I cannot recall how I solved it but I did run across this post http://lists.automattic.com/pipermail/wp-trac/2008-April/025821.html It's for earlier WP versions but it wouldn't hurt to check it. Oh, have you checked to make sure the paths are correct?? /hermes/bosweb/web080/b807/ipg.aandbwebdesign/wp-content/themes/aAndbWebDesign/ I am not familiar with iPage folder structure. Edited February 17, 2010 by newseed Quote Link to comment Share on other sites More sharing options...
falkencreative Posted February 17, 2010 Report Share Posted February 17, 2010 According to this page: http://codex.wordpress.org/Function_Reference/get_post it looks like you need to specify the id of the post you want to get. If you find the page id of the home page and place it within the parenthesis like so (assuming your home page id is 7): $post = get_post(7); That should fix it. I'm not sure why it's working fine on your other installation of WP though. I believe you can find that page id by logging in to wordpress, going to the "Posts" section, and placing your mouse over the "Edit" link on the home page post. You should get something like this: http://www.yourdomain.net/wp-admin/post.php?action=edit&post=268 I believe the value after "post=" is the page id. Quote Link to comment Share on other sites More sharing options...
Andrea Posted February 18, 2010 Author Report Share Posted February 18, 2010 Thank you guys. Newseed's link had the answer. I wonder so... Wordpress has just come out with another upgrade which I am using right now. When I initially built the template while following along the video tutorial, I was using the previous version. The part of the php that's affected, Jon called 'an API hack'. Maybe it's something that doesn't work in the very latest Wordpress version. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.