GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   wordpress tip: link (plug) an external site (https://gfy.com/showthread.php?t=893575)

fris 03-13-2009 05:45 PM

wordpress tip: link (plug) an external site
 
Sometimes people pay for advertising and want a direct link the site in question, or maybe you just want to link to another site without viewing a post.

I found this cool snippet via http://www.istudioweb.com/hacking-wo...le-2008-01-12/

I edited mine a bit, bascially you add a custom field plug and put the url you want it to goto, if no custom field is set it will be a regular post.

Code:

function plugit() {
        global $post;
        $post_id = get_post($post->ID);
        $title = $post_id->post_title;
        $perm  = get_permalink($post_id);
        $plug = get_post_custom_values('plug');
        if (empty($plug)) {
                $link = $perm;
        }
        else {
                $link = $plug[0];
        }
        echo '<a href="'.$link.'" rel="bookmark" title="'.$title.'">';
}

Heres a site of mine I have it in use.

http://i42.tinypic.com/2mg8nc8.jpg

Nicky 03-13-2009 05:52 PM

Thanks Fris.

Ozarkz 03-13-2009 07:31 PM

That's awesome very useful.

Thurbs 03-13-2009 07:34 PM

Hey Fris - would you have time to discuss a wordpress idea I had? perhaps you might know a non "hacked" up way to do some advanced layout & ordering stuff.

pornpf69 03-13-2009 07:51 PM

thanks for sharing it!!

fris 03-13-2009 08:41 PM

icq: 704-299 will be on for a couple more hours

blonda80 03-13-2009 11:44 PM

very useful


All times are GMT -7. The time now is 06:08 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc