Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 09-17-2009, 07:52 PM   #1
Angry Jew Cat - Banned for Life
(felis madjewicus)
 
Industry Role:
Join Date: Jul 2006
Location: In Mom & Dad's Basement
Posts: 20,368
wordpress question: calling in the_permalink in post content?

Say I want a link within my content to link to

Code:
<?php the_permalink() ?>
before i know what my actual permalink is, say for template use. What is the proper way to link to the_permalink in my template? i tried a simple

Code:
<a href="<?php the_permalink() ?>">
sort of thing, but it doesn't really work. Any tips?
Angry Jew Cat - Banned for Life is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-17-2009, 08:06 PM   #2
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,359
dont know why you want too, but you could create a shortcode to do it, or via a plugin.

http://justintadlock.com/archives/20...rdpress-plugin
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-17-2009, 08:11 PM   #3
Angry Jew Cat - Banned for Life
(felis madjewicus)
 
Industry Role:
Join Date: Jul 2006
Location: In Mom & Dad's Basement
Posts: 20,368
I am working on a script which automates my content creation for certain projects. All the post data is written into an XML file for importing into wordpress after it's creation. In my post template I would like to link an image from the excerpt into the single.php version of the_content. If you follow?
Angry Jew Cat - Banned for Life is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-17-2009, 08:18 PM   #4
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,359
heres a few others to look at

http://justintadlock.com/archives/20...rdpress-plugin

http://wordpress.org/extend/plugins/rb-internal-links/

or some code to do it via your functions.php file

Code:
function print_link($atts, $content = null) {
        global $post;
        $permalink = get_permalink($post->ID);
        return '<a href="'.$permalink.'">'.$content.'</a>';
}

add_shortcode('mypermalink','print_link');
then you would do
Code:
[mypermalink]title you want[/mypermalink]
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-17-2009, 08:24 PM   #5
Angry Jew Cat - Banned for Life
(felis madjewicus)
 
Industry Role:
Join Date: Jul 2006
Location: In Mom & Dad's Basement
Posts: 20,368
Quote:
Originally Posted by fris View Post
dont know why you want too, but you could create a shortcode to do it, or via a plugin.

http://justintadlock.com/archives/20...rdpress-plugin
I just tried this one, and it works very well aside from the fact that the shortcodes do not function within "the_excerpt" and only work in "the_content". I'll look through the other couple options you've listed. Thanks Fris...
Angry Jew Cat - Banned for Life is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-17-2009, 08:37 PM   #6
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,359
you could probably modify it to work with excerpt as well, probably just 1 line of code to add the filter for excerpt as well as the_content
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-17-2009, 08:42 PM   #7
Angry Jew Cat - Banned for Life
(felis madjewicus)
 
Industry Role:
Join Date: Jul 2006
Location: In Mom & Dad's Basement
Posts: 20,368
Quote:
Originally Posted by fris View Post
you could probably modify it to work with excerpt as well, probably just 1 line of code to add the filter for excerpt as well as the_content
Yup, added the following to my functions.php and the shortcodes now execute fine in the_excerpt with the Template Tag Shortcuts plugin...

Code:
add_filter('the_excerpt', 'do_shortcode');
Angry Jew Cat - Banned for Life is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-17-2009, 10:04 PM   #8
Angry Jew Cat - Banned for Life
(felis madjewicus)
 
Industry Role:
Join Date: Jul 2006
Location: In Mom & Dad's Basement
Posts: 20,368
from one headache to the next. now i'm having trouble gettign the_excerpt to import from my XML file. The post imports fine, but the excerpt is left hanging Don't suppose you got much experience with creating XMLs for import do ya fris?
Angry Jew Cat - Banned for Life is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.