Plugin Directory

Changeset 618061


Ignore:
Timestamp:
10/27/2012 05:36:52 PM (13 years ago)
Author:
miltonbjones
Message:

add support for having some posts link to external URL while other posts still link to internal permalink

Location:
link-blog
Files:
5 added
3 edited

Legend:

Unmodified
Added
Removed
  • link-blog/trunk/link-blog.php

    r617891 r618061  
    44Plugin URI: http://www.webworkgarage.com/link-blog-wordpress-plugin/
    55Description: Allows you to create a simple link blog with WordPress.
    6 Version: 1.1
     6Version: 1.2
    77Author: Milton Brian Jones
    88Author URI: http://www.miltonbjones.com
     
    117117<?php
    118118
    119 // build the function/template tag for displaying the exernal link URL
     119// build the function/template tag for displaying the exernal link URL (if thre is one)
    120120
    121121function mbj_link_blog_link_url_display() {
     
    123123global $post;
    124124
    125 $my_post_id = $post->ID;
    126 $my_link_url = get_post_meta($post->ID, mbj_link_blog_link_url, true);
     125
     126if (get_post_meta($post->ID, mbj_link_blog_link_url, true) != '') {
     127
     128    $my_link_url = get_post_meta($post->ID, mbj_link_blog_link_url, true);
     129
     130    }
     131   
     132else { $my_link_url = get_permalink($id); }
     133
    127134echo $my_link_url;
    128135
  • link-blog/trunk/readme.txt

    r617891 r618061  
    55Requires at least: 3.4
    66Tested up to: 3.4
    7 Stable tag: 1.1
     7Stable tag: 1.2
    88License: GPLv2
    99
     
    1313
    1414There are many ways to make a link blog, and many ways to do it with WordPress other than using this plugin, but I made this plugin to do it a certain way that I think is pretty easy to deal with. [More Information](http://www.webworkgarage.com/link-blog-wordpress-plugin/)
    15 
    1615
    1716
     
    3433= How does the plugin work? =
    3534
    36 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 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()`.
     35Basically 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. 
     36
     37The 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()`.
     38
     39= What if I want some posts to link to external sites and some posts to link to the internal permalink? =
     40
     41If 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.
    3742
    3843
     
    4550= 1.0 =
    4651* Plugin Launched
     52
     53= 1.1 =
     54* Fixed an error with settings page; basically there shouldn't have been a settings page in the first place and that was the problem
     55
     56= 1.2 =
     57* Added support for having some posts be link posts and other posts still link to internal permalink
Note: See TracChangeset for help on using the changeset viewer.