WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] SEO-friendly internal links? (3 posts)

  1. aliceralph
    Member
    Posted 3 years ago #

    Hi,

    I have just launched a new website this morning (woo!)

    One quick question - I currently have links hard-coded into the template, for example:

    <a href="index.php?page_id=18">
    <img src="<?php bloginfo('template_url'); ?>/images/mirrors.jpg" alt="Mirrors" height="200" width="200"/>
    </a>

    This is built into a custom Page Template.

    I have since set my Permalinks to SEF but the custom hard-coded links (above) are obviously not being rewritten (they point to the right pages but the initial link itself is not the same). Obviously for SEO purposes I want these to rewrite as well.

    Is the easiest way of doing this something like:

    <a href="<?php echo get_settings('home'); ?>/mirrors/">
    <img src="<?php bloginfo('template_url'); ?>/images/mirrors.jpg" alt="Mirrors" height="200" width="200"/>
    </a>

    ?? Anybody know of a better way?

  2. keesiemeijer
    moderator
    Posted 3 years ago #

    try it with:

    <a href="<?php echo get_permalink(18); ?>">
  3. aliceralph
    Member
    Posted 3 years ago #

    Hi, just wanted to say thanks this was really helpful!

Topic Closed

This topic has been closed to new replies.

About this Topic