开发者 | miltonbjones |
---|---|
更新时间 | 2018年8月3日 13:01 |
捐献地址: | 去捐款 |
PHP版本: | 3.4 及以上 |
WordPress版本: | 4.4 |
版权: | GPLv2 |
/wp-content/plugins/
directory<?php if (function_exists('mbj_link_blog_link_url_display')) { mbj_link_blog_link_url_display(); } ?>
in all the places you want to link to the external URL you are writing about rather than the internal permalink. Typically this will be in the link markup that surrounds the title of a post on your blog index page, replacing <?php the_permalink(); ?>
.When you think about a standard blog, you'll typically have an index page with a bunch of posts listed in reverse chronological order. That index page might have 3, 5, 10 posts on it, who knows. If you want to see just one article, you normally can click on the title of the post to get there. Then if you want to send somebody a link to just that post, you can send them the link to that URL, since it shows that one single post only. That link is called a permalink. That's pretty much a standard term, and it's the terminology used in WordPress. In fact, the_permalink()
is the WordPress function that echoes that URL for a given post.
Most of the time that is fine and good, but a link blog is a little different. Link blogs typically are designed around finding interesting web pages (articles, websites, resources, etc.), perhaps showing a quick excerpt from the page, making a comment about it, and then providing a link to the mentioned web page. The standard format of a link blog is to have the title of the post on the index page link to the external website being discussed rather than to the internal permalink for the blog post on the link blog.
This plugin (Link Blog) makes it easy for you to create a link blog with WordPress while letting you maintain control over where you place the external link URL and where you place your internal permalink.
Basically the plugin adds a meta box to your Edit Post screen that allows you to add a link URL to each blog post you write. The meta box has a heading of Link Blog Info and it has one field labeled URL to link to:, which is where you'll type in the external URL you want to link to.
The plugin also provides a function (or template tag) for echoing that link URL in your theme wherever you want it. I know that involves getting into the code, which some people aren't comfortable with, but a lot of people who want link blogs still want to also use a permalink for each post on the index page too, so I didn't want to make the external link URL just replace all the permalinks on your blog. This way, you can do something like put the external link URL template tag around the title of your post, and still have something like "Posted on October 12" formatted as a link to the permalink, the_permalink()
.
If you want your blog to be a hybrid that includes some link posts (linking to external sites) and some traditional posts (linking to internal permalinks), you can do that with this plugin. All you have to do is leave the URL to link to: field blank and that particular post will still link to the standard permalink.