WordPress.org

Ready to get started?Download WordPress

Forums

Blog posts not showing (20 posts)

  1. mickdude2001
    Member
    Posted 5 months ago #

    Hi everyone!

    I have converted a php website to wordpress and am having no end of trouble with the blog page. I set up a page called 'blog' and set that to be my blog page in reading settings but no posts show up (there are two published posts) at all. I know wordpress uses the index.php to show posts and I have checked the loop inside this file and all looks good.

    It seems as if it is picking up the page template rather than the index template?

    Also, in page attributes there is no option to select a template i.e. default for blog posts.

    This is the first time I have converted a php site to wordpress so I guess I've missed something... but what? I followed instructions at the link below:
    http://blog.spoongraphics.co.uk/tutorials/how-to-build-a-custom-wordpress-theme-from-scratch

    The site I am working on is http://webhosting4uk.co.uk/indianspiceschool/blog/

    Any help would be appreciated!
    Thanks in advance.

  2. domokun
    Member
    Posted 5 months ago #

    Couple of things:

    if this is using single.php, then this is also not showing your post data, so check your tag usage and loop again

    http://webhosting4uk.co.uk/indianspiceschool/hello-world/

    Next, try viewing the category archive page by going to Posts > Categories and then clicking View under the Category Name containing your posts

  3. alchymyth
    Forum Moderator
    Posted 5 months ago #

    check that there is no home.php in your theme; http://codex.wordpress.org/Template_Hierarchy

    what is the exact code of index.php?
    please use the pastebin - http://codex.wordpress.org/Forum_Welcome#Posting_Code

  4. mickdude2001
    Member
    Posted 5 months ago #

    domokun
    Yes I am using single.php here is the code:
    <script src="http://pastebin.com/embed_js.php?i=c12QmNWY"></script>

    I also checked category archive and no posts there.

    alchymyth
    There is no home.php in the theme folder, I am using index.php for the blog and page.php for static pages. index.php code below:
    <script src="http://pastebin.com/embed_js.php?i=q9cbwt57"></script>

    This is the first time I've converted a pure php template to wordpress so I guess I am missing something fundamental?

    Thanks for the help so far guys!

  5. mickdude2001
    Member
    Posted 5 months ago #

    Sorry guys i forgot to use the code tags :(

    <script src="http://pastebin.com/embed_js.php?i=c12QmNWY"></script>
    <script src="http://pastebin.com/embed_js.php?i=q9cbwt57"></script>

  6. domokun
    Member
    Posted 5 months ago #

    OK, what does the content of content-page.php and content-post.php look like?

  7. mickdude2001
    Member
    Posted 5 months ago #

    Hi,

    I don't actually have any of those files in my theme folder???

    I did say I was new to this :)

  8. domokun
    Member
    Posted 5 months ago #

    *ding*

    Ok, well both of the pages that you pasted into pastebin reference these files.
    So the fact they don't exist, could explain why nothing appears.

    On line 14 of single.php, can you change it to this

    // Start the Loop.
    while ( have_posts() ) : the_post();
    echo '<h1>'.get_the_title().'</h1>';

    Does your blog title start to appear now?

  9. mickdude2001
    Member
    Posted 5 months ago #

    Ok I still don't see anything on the blog page but when I preview any post I see the post title... getting there slowly!

  10. domokun
    Member
    Posted 5 months ago #

    Great, so start inserting the necessary post tags (the_content, the_title, the_time etc.) in and you should start making headway.

    Good luck

  11. mickdude2001
    Member
    Posted 5 months ago #

    Ok your suggestions are working but I only see the title, content and anything else I add to single.php in the post preview. I see nothing on the main blog page?

    Thanks for your help so far - I owe you a beer :)

  12. mickdude2001
    Member
    Posted 5 months ago #

    Hi,

    I'm still confused why I am not seeing posts in the blog post page but see them when in preview mode.

    Sorry to be a pain but as I say, I'm new at this and hopefully once I get this fixed I'll be able to do further conversions without getting stuck :(

    Thanks again.

  13. domokun
    Member
    Posted 5 months ago #

    I can see it (albeit hidden behind your logo)

    http://webhosting4uk.co.uk/indianspiceschool/hello-world/

  14. mickdude2001
    Member
    Posted 5 months ago #

    Yep can see that thanks! The thing is, I still don't see any posts on the main blog page i.e. here

    How do i get the posts feed to display on this page?

    Again, thanks for your help so far!

  15. domokun
    Member
    Posted 5 months ago #

    Remind me which template is running on that page again?

    I think it'll either be index.php or category.php or archive.php

    You'll want to review each of those to ensure they're not making calls to files that dont exist and therefore you'll want to edit the loop to include the tags as you need them

  16. mickdude2001
    Member
    Posted 5 months ago #

    I'm using index.php for this page. Code below:
    index.php

  17. mickdude2001
    Member
    Posted 5 months ago #

    Also, in index.php there is a call for the header but the header isn't showing either. Stumped...:(

  18. mickdude2001
    Member
    Posted 5 months ago #

    Ok latest update:

    I changed the references to 'content' in index.php to 'content-page' and now we are in business with the blog page. The only other strange one is that the header is not displaying even though I call it at the top of index.php. Any ideas?

    Again, thanks for the pointers I really appreciate the help!

  19. mickdude2001
    Member
    Posted 5 months ago #

    Ok guys I think i have cracked it now. I needed to detect if on the blog page and if so display a custom banner at the top. I ended up using this code

    All is resolved now so a big thank-you to those that came forward with suggestions.

    Thanks again!

  20. domokun
    Member
    Posted 5 months ago #

    Good work.

    Please mark this thread as [resolved]

Reply

You must log in to post.

About this Topic