[resolved] Help skipping top title/header on all posts (9 posts)

  1. thriftyreads
    Posted 5 years ago #

    I need some help figuring out how to get the links from the main page of my site (when people click "read more" or just click on the posts) to go not just to the post, but automatically jump to a point in the post. Specifically, I want the links to skip past my rather large logo/website title and go right to the top of the post content.

    The site in question is http://www.thriftyreads.com. I was thinking it might be possible to do it somehow using anchors in the php files that structure the "post" pages, but after searching for the entirety of the day about how to do it to much frustration, I'm reverting to just asking for help here.

    So here's what the site looks like now:


    When you click on one of the posts, it takes you to a page that looks like this:


    As you can see, the title of the page "Thrifty Reads" is enormous, and causes users to scroll down to see the post. I want to keep the logo/title for the main page and all other pages, but have links to posts automatically skip the logo. So that when a user clicks on one of the posts from the main page, they get sent to the post page with the page already scrolled past the title. So that it looks like this:


    Help is very much appreciated. I don't know if there is a plugin that can do this for me, or if somebody can help with editing the .php files so that it's automatically set up like that..


  2. Michael
    Forum Moderator
    Posted 5 years ago #

    try and append #breadcrumbs to the links on the frontpage (might be in index.php?);

    something with the_permalink() probably multiple times (on the image and on the post title)

  3. thriftyreads
    Posted 5 years ago #

    What would I change the_permalink() to to get that?

    For example, mine looks like:

    <a href="<?php the_permalink(); ?>">

    Where would I need to add #breadcrumbs to it?

  4. keesiemeijer
    Posted 5 years ago #

    Try this:
    <a href="<?php the_permalink(); ?>#breadcrumbs">

  5. thriftyreads
    Posted 5 years ago #

    ok, trying now..

  6. thriftyreads
    Posted 5 years ago #

    Ok, I found all instances of

    <a href="<?php the_permalink(); ?>">

    In all my .php files, and replaced them all with

    <a href="<?php the_permalink(); ?>#breadcrumbs">

    Unfortunately, it didn't do anything for the links on my main page (thriftyreads.com). Any suggestions?


    RESOLVED! I had to clear cache to get it all to work. Thanks guys!

  7. Joni
    Posted 5 years ago #

    In addition to that, you'll need to use the name anchor where you want the user to start reading. I imagine that would be the title of the post?

    Wherever in your single.php template you want the user to be taken, add this:

    <a name="breadcrumbs"></a>

    It's this HTML code, which has been around forever, that is at work here:
    Read the above article at "HTML Links: The Name Attribute."

  8. Joni
    Posted 5 years ago #

    Firefox, right? I hate that caching behavior. I have mine turned off (in the browser address bar, type about:config, search for http: and find where it talks about caching pages and double-click to change value to false/no.

  9. thriftyreads
    Posted 5 years ago #

    ^ exactly ;) Thanks for the further help

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.