Adding Links to Other Blog Pages in a WordPress Post

Many times I have wanted to reference and link to another post in my blog from within a post or a page. This short tutorial will show you how to link to another post from within a post on any WordPress blog. I will show you how to create links to posts, pages and even categories. If you are using permalinks, you can simply use the permalink, so this guide is for those of us that don’t always use permalinks.

For example, CLICK HERE TO SEE ALL OF MY WORDPRESS POSTS on this blog! and then look below to see how I did this.

First of all, I created the above link using the visual view that most people are most familiar with when using the WYSIWYG editor in the WordPress admin, however, after a quick demonstration on how I did it, the rest of this tutorial will be based on how to add links using the Text view tab in the WYSIWYG editor, just because it is easier to explain from a coder’s perspective.

To create the link to my WordPress category, I typed the text “CLICK HERE TO SEE….” then highlighted that text and clicked on the link icon in the editor’s tool bar. In the link dialog box that pops up, I replaced the default “http://” with just “index.php cat=48”, ,checked the box to make the link open in a new window and saved it. That’s it!

Getting the Category ID

you need the category ID for the link. The id for my blog’s WordPress category was 48 in the above example as you can see. To get it, go to your WordPress admin area and go to posts/categories then hover over the category title and you will see a number in your browsers info bar which is at the bottom left of the webpages in Firefox and most other browsers. Sometimes you might have to activate the info bar from your browser/settings dialog if you don’t see anything when hovering over links. The ID for categories will be right after the text that reads “tag_ID=” in the info bar when hovering over the category name in the edit category page.

 

Linking Without Permalinks

If you’re not using Permalinks, here is how to link to pages, posts, and categories:

*Using the number values found in the ID column of the Posts, Categories, and Pages Administration, you can create links as follows.

Posts

To link to a Post, find the ID of the target post on the Posts administration panel, and insert it in place of the ‘123’ in this link:

<a href="index.php?p=123">Post Title</a>

Categories

To link to a Category, find the ID of the target Category on the Categories administration panel, and insert it in place of the ‘7’ in this link:

<a href="index.php?cat=7">Category Title</a>

Pages

To link to a Page, find the ID of the target Page on the Pages administration panel, and insert it in place of the ’42’ in this link:

<a href="index.php?page_id=42">Page title</a>

*information from the asteric to here was taken from http://codex.wordpress.org/Linking_Posts_Pages_and_Categories

Leave a Reply

Your email address will not be published. Required fields are marked *