Support » Fixing WordPress » Making all posts point to external links?

  • Hi all,
    I’ve seen a hack something like this, but not quite – I’m hoping someone can help me tweak my WP install.
    I run a site that does links to interesting stories (you can check out the structure at Currently, I’m coding it all by hand, by want to use WP to drive the site.
    Each entry on my page consists of a title, a category, and a brief description. So far, so good. But the link on the title of the story does NOT point to a blog entry – rather, it points to an external link (using target = blank to spawn a new window).
    Does anyone know of a way to hack WP so that I can (a) make the title link point to a specified URL, and (b) eliminate a separate htm file for each post? (there won’t be comments, so there doesn’t need to be a page for each post – they’ll only exist as part of the larger page).
    Thanks in advance – this is without a doubt the nicest community of folks I’ve been on in some time.

Viewing 7 replies - 1 through 7 (of 7 total)
  • before anyone else say it, let me specify…
    target breaks xhtml validation. 🙁

    a) target = blank is evil, it’s not xhtml compliant. That said, making the title a link to an external site would take a lot of work, since the title automatically points to the individual page for the post.
    I would suggest you have a title, and then, beneath it, the link you want, with a brief description, in the post.
    b) WP creates no htm files. The one index.php displays different content depending on the parameters passed to it. WordPress does this automatically (passing the parameters based on the links you click, building those links etc). In short, no “static” file with the contents of the articles.

    The title does not necessarily have to point to the permalink for the post. You can change this in the index.php file. The link is generated by
    echo get_permalink();
    Remove the link in index.php. Then when you enter the title in the post, you can also enter the html for the link to your external page. If you are using 1.2b, a more elegant solution could probably be created using the post meta data fields.

    Instead of target=”_blank” you could also set rel=”external” in all your links and use javascript to treat it as a target.

    OK, got it about target. Will scrap that portion of it.
    cbtlsl – I’ve tried putting a href tags in the title field, but they display incorrectly – they seem to choke somewhere around the “> mark. Obviously, if this were doable, I’d just code the hyperlink into the title field and forget about it. Should I be able to code hyperlinks into the title field?

    what cbtlsl said was that the echo get_permalink(); be removed from the index.php page. Then you should try putting links in the titles. If the < and > give you a problem, you should try the encoder tool.
    That said, I think using the post meta field is a much better idea.
    I take back what I said about the mod being “difficult” 🙂 My words are tasty and so I eat them whenever I get a chance 😉

    fargon, I’m all for elegant – could you expand on this meta field idea, for this newbie?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Making all posts point to external links?’ is closed to new replies.