• Title links for single posts don’t link correctly. Goes to the same wrong page every time but the title for the desired page remains correct. Having trouble finding the error. Is this an issue with the permalink or an issue with categories? I have no idea. I’m new with code so the answer might be simple and I’m just not seeing it.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Can you post both the correct link (the link the title should link to) and your code for the title (including the anchor)?

    You might want to check that you have a single.php template file in your theme, or else your post defaults to index.php for its theming (see here). Also, check that your get_permalink().

    Thread Starter cabalan

    (@cabalan)

    I have a single.php template. The page of origin (https://www.meksin.com/category/news/) I’m having issues with is a category list/ blog setup, displaying single posts in chronological order. The top post displayed being “Flossing the Lot.” In single.php the code for the post looks like this:

    <!--POST TITLE-->
    				<h2 class="post-title"><a title="'<?php the_title_attribute(); ?>',  href="<?php the_permalink() ?>"><?php the_title(''); ?></a></h2>
    				<!--END POST TITLE-->

    My permalinks are customized to follow this format: /%category%/%postname%/. I don’t know if that matters.

    All the title links on the page of origin link to the same page (in the body) but go to the correct url and have the correct title. For example the top post for Flossing goes to https://www.meksin.com/news/flossing-the-lot-new-haven-ct-2012/, displaying the body of a draft that has been set to private of a post that isn’t even categorized. But the draft is the most recent creation so I don’t know if there is some kind of time issue.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Link Issues’ is closed to new replies.