WordPress.org

Ready to get started?Download WordPress

Forums

No header in the single posts page (9 posts)

  1. Situation
    Member
    Posted 8 years ago #

    Hello everyone! First of all sorry for my english...I tried to have an answer from Italian forum, but they didn't help me...so here I am!

    I have two big problems, and I need an answer to resolve them...

    FIRST PROBLEM:
    I moved the loop on a static page, instead of keeping it on the homepage as all blogs ( http://www.allofu2.com/notizie ). At the end of the page I put this piece of code:

    <div class="navigation">
    <div class="alignleft"><?php posts_nav_link('', '', '&laquo; Previous Entries') ?></div>
    <div class="alignright"><?php posts_nav_link('', 'Next Entries &raquo;', '') ?></div>
    </div>

    Clicking on the "previous entries" link on the bottom of the page I get a 404 error page, instead of previous posts, as should be (without header, too). Where the old posts have gone? Is there something wrong into the code above?

    SECOND PROBLEM:
    I recently switched my blog from Windows Hosting to Linux Hosting (on Apache server), and I activated permalinks. When I try to see if permalinks work, clicking on a post permalink I see the single post page without any header!
    The same result appears if I try some search, or if I browse into my archives or categories, but not with static pages or with the homepage. If I switch back to non-permalink mode, the header comes back.
    Checking my "single.php" page (and "archives.php" or "search.php", too) I can't see something strange, because I think that <?php get_header(); ?> function is at the right place...at the very top of the code.

    I hope someone could help me someway, and in the meanwhile I thank you all...

  2. moshu
    Member
    Posted 8 years ago #

    If you make that first page a short one I might take a look at it. I hate 10 km long pages (and to look at their code), sorry. Actually even for other visitors it must be annoying: I am on fast cable connection and it takes a long-long time to get the whole page. Very much not userfriendly :(

  3. Situation
    Member
    Posted 8 years ago #

    Ok...I'll shorten the code of my "news" page...here it is:

    <?php
    /*
    Template Name: News
    */
    ?>

    <?php get_header(); ?>
    <div id="wrapper">

    <div id="content" class="narrowcolumn">

    ------> TITLE <------

    <div id="listenews">
    ------> ARCHIVES <------
    ------> CATEGORIES <------
    </div>

    <?php query_posts('posts_per_page=20'); ?>

    ------> THE LOOP (Start) <------

    ...

    ----------------------
    NAVIGATION BAR (Start)
    ----------------------
    <div class="navigation">
    <div class="alignleft"><?php posts_nav_link('', '', '&laquo; Articoli Precedenti') ?></div>
    <div class="alignright"><?php posts_nav_link('', 'Articoli Successivi &raquo;', '') ?></div>
    </div>

    --------------------
    NAVIGATION BAR (End)
    --------------------

    ...

    ------> THE LOOP (End) <------
    </div>

    <?php get_sidebar(); ?>
    </div>
    <?php get_footer(); ?>

  4. moshu
    Member
    Posted 8 years ago #

    Actually I was saying to make the web page shorter... = to not display a zillion posts!

    Problem numero uno. The next/previous will not work if you are not using the index for the frontpage.

    2. I don't know, it may be related to No.1.

  5. Situation
    Member
    Posted 8 years ago #

    Uh....sorry....I thought you would like to see the code...misunderstanding :-)

    So....for No.2, there's no escaping? :-(
    I don't think that it's related to No.1, because the problem appears in other pages...

  6. moshu
    Member
    Posted 8 years ago #

    I am just curious: if you use the normal index.php instead of your notizie Page - does the problem No2 still exist?

  7. Situation
    Member
    Posted 8 years ago #

    I tried to move again The Loop in the normal index.php page, but the problem still exists, both in the single posts and in the archives or search pages.

  8. Situation
    Member
    Posted 8 years ago #

    I fixed problem no. 2

    It seems it was enough just to use an absolute URL for the header image, instead of a relative one...

    The strangeness of this thing is that with the error I had, I should not have seen the header nowhere, instead of seeing it only in some page...

  9. moshu
    Member
    Posted 8 years ago #

    The strangeness of this thing is that with the error I had, I should not have seen the header nowhere, instead of seeing it only in some page...

    That's not entirely true.
    If you have a relative path that might work from the main page (as you calculated from there, eg. images/mypic for
    example.com/images/mypic.jpg), but when you move to another page, let's say:
    example.com/subdir/newpage.ext
    it will look for the image at
    example.com/subdir/newpage.etx/images/mypic.jpg

    That's why you didn't see it.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.