Post Links

Post Links is a Wordpress plugin that enables you to associate any number of links with a particular post.

Dowload the plugin from Wordpress.org

1. Installation instructions

Unzip the file and copy it to wp-content/plugins/. Then activate it in the Wordpress Admin for Plugins. Once activated, the link form will appear on the Write/Edit page.

2. The ‘Links’ box on the Write/Edit page

The plugin makes a box in the admin that looks like this:

Link box on the Write/Edit page

Links are dynamically created and deleted in this box, and they can be moved up and down in the list. The order that they are shown in in the admin is also the order that they are generated in the template.

3. Displaying links in templates

The links can then be displayed inside a template using:

  <?php post_links(); ?>

The default is to create a dl/dt/dd list, which can be styled using css.

3.1 Slightly more advanced use

If you’re not a fan of dl/dt/dd lists you can create an oldschool ul/li list like this:

<?php
  $args = array('format' => 'ul');
  post_links($args);
?>

Now, what if you want to wrap all the links in a div with id=’post-links’ and have a h3 title at the top? Post Links supports that too:

<?php
  $args = array('format' => 'ul', 'div' => 'post-links', 'title' => 'Check out these links');
  post_links($args);
?>

The div will only be created if there are links to display, otherwise it wil display nothing.

4. Languages

It supports translation files, but is has as of yet only been translated to Swedish.

5. License

The More Fields Wordpress plugin is relased under GPL, and the following license can be found in the header of more-fields.php.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see

45 Comments to “Post Links”

  1. Tim Says:

    Tried to install your plugin on 2.3, but I get the following error:
    Plugin file does not exits.

    Any idea what could be the problem?

    Thanks
    Tim

  2. Ricardo Senise Says:

    Sure it’s a great plugin! Thank you!
    My only suggestion by now is putting the “Slightly more advanced use” under the Option menu in WP!
    I made a translation for Brazilian Portuguese, how could I send it?

  3. Marco Says:

    Great plugin. Is there a way to add a “target=_blank” to the plugin? So that links are opening in a new window?

  4. Chris Knowles Says:

    Is there a simple way to switch this plugin on for pages?

    It only seems to work for posts.

    Cheers.

  5. Igor Says:

    Thanks for This Plugin Very much!

  6. Vegan Recipe Blog Says:

    We had this plugin installed on our vegan recipe blog, before we relaunched, i think it’s time to add it again! It’s a great plugin!

  7. Chris Says:

    Very nice, does what I was looking for.

    I was wondering how I would make the same plugin again, so I can have different Link Categories and style them accordingly in the theme.

    Cheers!

  8. Tari Says:

    “Is there a way to add a “target=_blank” to the plugin? So that links are opening in a new window?”

    I was wondering that too :)

  9. Ronche Says:

    Great Plugin! Any chance we’ll get compatibility with 2.5? Just upgraded and this plugin seems to have some issues. Also, I definitely echo the request for being able to set the target on links as well. Thanks!

  10. Henrik Melin Says:

    Yeah, I’m going to make it compatible with WordPress 2.5 when I get the time to do it. Hopefully it won’t be too long… Thanks for your feedback!

  11. WP Plugin Archive » Post Links Says:

    [...] Post Links von Henrik Melin kann einem Beitrag eine beliebige Anzahl Links hinzugefügt werden. Die [...]

  12. Separatista Says:

    Hello, upgrade this plugin to WP 2.5 would be very appreciated. Thanks for your help…

  13. Henrik Says:

    It would be cool, if the plugin could support the following things:

    - working properly in Wordpress 2.5
    - make an target=”_blank” tag possible
    - adding the field “category”, so there can be different sections of links (e.g. Wiki-links, The Web, Youtube-Videos, etc.)

    Looking forward for new updates :)

    Greetings from a name-Sibling ;)

  14. Buster Says:

    Thank you for putting your efforts out there for us! You’re truly showing what can be done by a motivated free-thinker. Keep up the good work!

  15. Catskill Says:

    I have been using this for the past week. I have been very happy with it. I think the best upgrade for the plugin is a choice of the link opening in a new page.

    It would be even better if this choice was for each link— as some of the links are for my site and some links are for outside links to other sites.

    make an target=”_blank” tag possible as a choice for each individual link.

  16. Wordpress Post Links plugin | just another wordpress fun blog Says:

    [...] see http://labs.dagensskiva.com/plugins/post-links/ for more information on how to use this [...]

  17. Betsy G Says:

    Hey, your plugin and the instructions above are fantastic. I have related links only on the pages where I actually have related links. Awesome. I have two questions:

    1) I have the title wrapped in an and it looks like all my other s (i.e., white text on a boxy background) except that the point size is bigger. Any clue where it might be getting that point size from?

    2) The description shows as text below the link rather than when I hover. Is that by design? Or is there a way to put the description in a hover box?

    Thanks–I’m so pleased I’ve been able to get it 90% of where I want it so quickly.

  18. Betsy G Says:

    Correction to that last e-mail. I used an html code in the text as an example. I meant to say it was wrapped in an h2 and it looks like my other h2s except for the point size. Thank you.

  19. Betsy G Says:

    I actually fixed the h2 problem by taking the title info out of your conditional code sample above and just handling the h2 outside of it. I am wondering, since so many people are asking about blank, if there is an easy edit to the post_links.php file that would make make the targets always open in a new window? I tried setting post_links_open_in_blank to true at the top of the file, and that didn’t do anything.

    Thanks.

  20. Timo Says:

    Hello,
    I love your plugin. I use WP 2.5 and it works great.
    Is there a way to use a orderd list (1, 2, 3)? When I used ‘ol’ instead of ‘ul’ nothing is shown :-(

  21. Pete Says:

    Hi GR8 plugin and have got working with 2.5.1.

    However there is a small bug in the admin section. The links don’t move up and down when the buttons are clicked.

    Does anyone know how to fix this – its fairly urgent that I get this fixed.

    Also look here for opening links in new window…… I’ve got it working quite nicely.

    http://www.webdesignerwall.com/tutorials/jquery-tutorials-for-designers/

  22. lowR Says:

    Excellent plugin !
    I need also the “blank” function. Any news about it ?

  23. LORENZ Says:

    I have correct the blank fonction !!!

    On the file : post-link.php

    on lines 176 and 180 replace $target with target=\”_blank\”

    ;)

  24. Geert Says:

    Could someone help me with step 3, installation guide? “The default is to create a dl/dt/dd list” I don’t know how to do so.

    It is possible to manage step 2, but I see no links on my posts (if you watch my site, the available links are written ‘old scool’ :-)

  25. Dino Says:

    Mate can you upgrade this so it is counting number of hits to that link and add some cloacking option also and posibility of adding banner or picture?

    I would send you some donation for that.

  26. Sasha Says:

    Is it possible to place this in the sidebar of the single post? Thanks for a great plugin.

  27. Post Links Plugin | WordPress Plugins Database - WordPressPluginsDatabase.com Says:

    [...] see http://labs.dagensskiva.com/plugins/post-links/ for more information on how to use this plugin. …..read more Download Plugin! Version [...]

  28. Sébastien Says:

    hi,

    i have a suggestion : what about pre-fixing the $cfpx = ‘dsc_link_’; with an underscore like this $cfpx = ‘_dsc_link_’; so the links attributes won’t appear in the custom fields panel but only in their dedicated own box ?

    anyway, thanx for this plug-in :)

    best regards

    seb

  29. Sébastien Says:

    …and i’ve made a translation in french. if you’re interested, please contact me so i can send it to you by e-mail…

    seb

  30. Peder Says:

    Cannot delete link

    Just installed on 2.7.1 add a related link and it seemed to work. But now I cannot delete this link again.

    I click “Delete” it goes away. I click on “Save and continue editing” and the link is back?

  31. Tim Says:

    I like this a lot.

    I had to customise the script slightly, removing some paragraph tags, in order to get the plain unordered list of links that I wanted, but this is basically exactly what I was looking for.

    Great job; thanks!

  32. climbr.de Says:

    Great! exactly what i was looking for.
    Its also working fine with WP2.8
    very nice to customise via css!! good job

  33. Sébastien Says:

    hi again,

    i just came throw a big issue in wp2.8.2

    impossible to remove the links ! i don’t know if in previous wp versions there was the same problem because i used it essentialy to add links and never had to remove them…

    so i had to modify a bit your post_links_save() function. after the while loop and before the return, i added :

    for($i=$nbr;$i<1000;$i++){
    if(get_post_meta($post_id, $cfpx . $lfds[0] . ‘_’ . $i, true)){
    foreach ($lfds as $field) {
    $key = $cfpx . $field . ‘_’ . $nbr;
    delete_post_meta($post_id, $key);
    }
    }
    }

    it’s not very elegant but it worked !

    i hope this could help

    thanx

  34. Jacques Says:

    Hello,

    I use WP 2.8.3. I can only create one link and, like Sebastien, i can’t delete this link. I don’t know why.

    The buttons seem not active.

    It’s exactely what i want with the definition list.

    Thank you for that plugin.

    Jacques

  35. Jacques Says:

    Hello again, i see, in Firefox Console, some errors

    Warning: main(/home/sites/jacquespeters.com/public_html/Te_2009-/wp-content/plugins/post-links../wp-config.php) [function.main]: failed to open stream: No such file or directory in /home/sites/jacquespeters.com/public_html/Te_2009-/wp-content/plugins/post-links/post-links-js.php on line 2

    Fatal error: main() [function.require]: Failed opening required ‘/home/sites/jacquespeters.com/public_html/Te_2009-/wp-content/plugins/post-links../wp-config.php’ (include_path=’.:/usr/share/pear’) in /home/sites/jacquespeters.com/public_html/-Te_2009-/wp-content/plugins/post-links/post-links-js.php on line 2

    Can I correct it by myself ?

    Jacques

  36. jacques Says:

    I’ve reloaded post-links-js.php and trying randomly to fix wp.config path because WP is in a subdirectory (but i’m really not an expert guy)

    It seems working… on my WP 2.8.3

    Perhaps you can updated in the WP official plugins directory :

    “Compatible up to: 2.8.3″

    Thank you for your work

    Jacques

    (Sorry for my bad english)

    Can you update with the french translation of sebastien ?

  37. Icaro Says:

    Tack så mycket!

  38. Bill Says:

    Is there a way to show the links for all of the posts at once on the main page?

  39. john.andrews Says:

    Add new link button was not working in 2.8.4

    Changed post-links-js.php line:2 from

    require_once(dirname(__FILE__).’/../../../wp-config.php’);

    to

    require_once(dirname(__FILE__).’/../../../wp-load.php’);
    require_once(dirname(__FILE__).’/../../../wp-admin/admin.php’);

  40. vivian Says:

    Great ,this is what i am looking for ,thanks a lot!

  41. Jan | Designwithstyle Says:

    Thanks for your plugin!
    You really helped me with a problem with a customer. :)

  42. Tom Says:

    Hi :)

    Thanks for the plugin. It works on 2.8.4. Could sb please teach me how to style separate links created by this plugin via css :|

    We have made a game reviews site and we are now trying to add two buttons that will lead to download a game and the other to play on-line by using this plugin.
    Here’s a test page:
    http://gry-rekreacyjne.pl/recenzje/zrecznosciowe/a-ball-recenzja/

    At the botton there are two links genrated by post-link plugin: gry rekreacyjne and gry casual.

    The whole area is wrapped by a div tag. But I have no idea how to make links wrapped by span tag each. For example the first link would ALWAYS have span tag=”pobierz” and the second one =”online”.

    Please teach me how to do this by an example.

    I’ve also would like to separate those two links so they are in one line but one of them would be on the right styled with button and the other one on the left, but I think I will manage to do it hopefuly!) by reading tutorials online.

    Please help.

    Cheers

  43. Jeff Miller Says:

    Hi, I am trying this plugin with WordPress 2.8.6. Everything seems to be working fine. I made the edits mentioned in an above post (Lorenz – June 20, 2008), in order to get the links to open in a new window.

    My question: where can I make changes to the formatting of the link and the link description? I’d like to make the link bold, but not the description. I’d also like to add a little more space between the lines of the description. Thanks.

    Jeff

  44. Sourena Says:

    wish this plugin is great. I wish it could work with qTranslate so it could be used in bilingual websites. Currently it does not work with the short code [en] and the similar.

    Here is the link for the instructions to make it work:
    http://www.qianqin.de/qtranslate/forum/viewtopic.php?f=3&t=294

  45. bret Says:

    After I create some links and save, a bunch of Custom Field boxes become populated with a name of “dsc_link_description_0″ and a value of either link name or url. The post links work fine either way. is this how it works or is there something I should be doing?

    Thanks,

    And thanks again for a this simple plugin

Leave a Reply