Forums

Getting back to main page? (14 posts)

  1. lawtai
    Member
    Posted 7 years ago #

    I was thinking, if someone were to come to my site directly to an individual post, how would they know what to do to get back to my main page which would have my current listing of posts? I know that there's the header, but it's not very obvious for people unless they happen to move their mouse over the link.
    How do you guys have it so that people can figure out how to get back to your main page if they start off inside a post?

  2. BenDG
    Member
    Posted 7 years ago #

    You could add a homepage link in the sidebar (menu) or in the footer.

  3. IanD
    Member
    Posted 7 years ago #

    You could use:
    <?php if ($single) { ?>
    <?php previous_post('% |','','yes') ?> ">Home <?php next_post('| %','','yes') ?>
    <?php } ?>

    inside the loop, it give a nice [previous post | home | next post] link above the post.

  4. lawtai
    Member
    Posted 7 years ago #

    Does that show up as "Previous Post" or the actual "Name of previous post"?

  5. lawtai
    Member
    Posted 7 years ago #

    Thanks for the code IanD! It worked perfectly.
    It actually does show the name of the posts.

  6. mrkablooey
    Member
    Posted 7 years ago #

    which file does that get added to? thanks!

  7. mrkablooey
    Member
    Posted 7 years ago #

    okay found where this goes. "the loop" wasn't in one of the themes I had (at least the code wasn't the same) but it was in another. Now it looks right, except "Home" is just text (not a link). Looks like this:

    ">Home

    Is there something I'm missing (obviously!)?

    Thanks.

  8. IanD
    Member
    Posted 7 years ago #

    From memory it has to go below the date call.

  9. mrkablooey
    Member
    Posted 7 years ago #

    hmm, nope. ;-) i'll try dropping it down some more.

  10. mrkablooey
    Member
    Posted 7 years ago #

    still can't get it working. this is frustrating. just using the "classic" theme. Here's the top part of my index with the error:

    <?php
    get_header();
    ?>

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    <?php if ($single) { ?>
    <?php previous_post('% |','','yes') ?> ">Home <?php next_post('| %','','yes') ?>
    <?php } ?>

    <?php the_date('','<h2>','</h2>'); ?>

  11. lawtai
    Member
    Posted 7 years ago #

    you need to make Home a link by using the < a href > function

  12. mrkablooey
    Member
    Posted 7 years ago #

    hmm, ok, seems to work, now that I have:

    <?php
    get_header();
    ?>

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    <?php if ($single) { ?>
    <?php previous_post('% |','','yes') ?> Home <?php next_post('| %','','yes') ?>
    <?php } ?>

    <?php the_date('','<h2>','</h2>'); ?>

    Thanks. Color is black instead of the other which is red but I can probably deal with it. ;-) Thanks again.

  13. mrkablooey
    Member
    Posted 7 years ago #

    ha! fixed it. i'm so new at this it isn't even funny. anyhow, found a sixapart site with tags on it and changed the typical HTML href to:

    Home

    works great and colors match.
    thanks everyone.

  14. mrkablooey
    Member
    Posted 7 years ago #

    whoops...

    should be <a href="/wp/index.php">

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.