Added Permalinks Shortcode on WordPress
February 20th, 2010 By WP Tricks Posted in Tips
WordPress is: Themes, Plugins, Widget, Shortcode, PHP and GPL Licensed. Did you know that, beside Widgets, Another useful WordPress API is shortcode, and now I will show you how to added permalinks shortcode into our WordPress site. Why this shortcode is useful? because with permalinks shortcode The generated URL will be updated automatically, when original permalinks on page or post change.

How To Added Permalinks Shortcode
Let’s get started, write down permalinks shortcode functions on your functions.php in your current theme
function do_permalink($atts) {
extract(shortcode_atts(array(
'id' => 1,
'text' => "" // default value if none supplied
), $atts));
if ($text) {
$url = get_permalink($id);
return "<a href='$url'>$text</a>";
} else {
return get_permalink($id);
}
}
add_shortcode('permalink', 'do_permalink');
This code below using get_permalink() functions, it’s standard WordPress functions and created shortcode version with code above.
How to use permalinks shortcode? Follow this tutorial
<a href="[permalink id=49]">Basic Usage</a>
Or you can use this method too
[permalink id=49 text='providing text']
Thanks for DigWP for share this code, and I hope tutorial added permalinks shortcode is useful for your blog and more easy to added inlinks between your content (post or pages).
Please notes, this is only sample how we can make a good deal with WordPress shortcode. We can made more complicated shortcode if we need it.
Added Permalinks Shortcode on WordPress On The NET
How To Added Permalinks Shortcode on WordPress # WordPress Tricks ...
Shortcode is useful WordPress API, and on this post you'll got tutorial how to added Permalinks Shorcodes and make your WordPress site WOW read more
Source: http://wptricks.net/added-permalinks-shortcode-on-wordpress/
Shortcode API « WordPress Codex
Added Permalinks Shortcode Simple Tutorial how to added Permalinks Shortcode on WordPress Related . Shortcode: do_shortcode, add_shortcode, remove_shortcode, remove_all_shortcodes, ... read more
Source: http://codex.wordpress.org/Shortcode_API
Added Permalinks Shortcode on WordPress › WordPress Vote
Shortcode is another WordPress wonderful API, with shortcode we can added content easily and just work ;) we only need added some code in our ... read more
Source: http://wpvote.com/2010-03/wordpress-hints-tips/added-permalinks-shortcode-on-wordpress/
API # WordPress Tricks & Tips
Did you know that, beside Widgets, Another useful WordPress API is shortcode, and now I will show you how to added permalinks shortcode into our WordPress site. read more
Source: http://wptricks.net/tag/api/
Shortcode # WordPress Tricks & Tips
Did you know that, beside Widgets, Another useful WordPress API is shortcode, and now I will show you how to added permalinks shortcode into our WordPress site. read more
Source: http://wptricks.net/tag/shortcode/
Amazing Touch
That’s pretty cool thanks.
You are welcome…
awesome!!! ty
excellent , this is what I was looking for!!! thanks
Do you know of a plugin which will help me automatically change my slugs links because I’ve tried SEO post link, SEO slugs and more and can’t get it to do it on auto?
Of course, my opinion is that free press release distribution sites (like ours) are the most effective ways at building links and bettering SEO.
This is great news for all blogger using wordpress.
WordPress 2.5 is otherwise called as Shortcode API which are small functions that helps us to create macro coding to post a content. Trivial shortcode looks like [gallery] and it is easy to create.
These permalinks require a lot more changes than suggested especially with wordpress. I really appreciate your efforts !
RE: Shortcode
Wp Tricks
Firstoff Thanks – also excuse my ignorance but is the same thing not achieved by altering the permalink structure in WP Admin?
Fantastic tutorial. Easy and understandable. Thanks.
I’m trying to create a simple shortcode to show the post ID in my post. Something like [post_id], can you help me with the function php code??? Thank you in advance!
Great, this is what I’ve been looking for. I’m creating a free theme for the moment and this was one of my problems! Solved! Thanks!
awesome, thanks
Is there a solution to a similar problem with images and/or called in files? Right now I’m working on a theme (in a test location on a sub directory) and I want to be able to link in my header to a .js file without needing to go back and change that. I’m having the same prob with ’s too.I hope this question wasn’t too far off topic.
Thank you for the useful read. keep on!
Thanks a lot!
i had use WP for years and never hear about the shortcode:(
Sorry if this is off topic but I am totally new to PHP / MySQL / Programming in general. Anyone know a good place to get started learning?
Web design is similar (in a very simplistic way) to traditional print publishing. Every website is an information display container,
Thanks for the step by step guide, now it will be easier for me to edit the short code on my wordpress hosted site.
Thanks for the info dude. You have shared the thing which i was searching for a very long time. I am going to add this short code to my blog. Thanks for the info. I hope you ‘ll share some other informative posts with us.
Hey thanks so much for this. Finally.
Thanks a lot!
i had use WP for years and never hear about the shortcode:(
Fantastic tutorial. This is great news for all blogger using wordpress installers.
I had a problem with permalinks, but when I upgraded to wp 2.9 it allows you to simply add in the desired format, which I got from the org site. They are great and this is helpful.
Do you know of a plugin which will help me automatically change my slugs links because I’ve tried SEO post link, SEO slugs and more and can’t get it to do it on auto? Thanks
Thank you! I’m teaching myself wordpress at the moment and appreciate the article.
Using Word Press we can made more complicated short code if we need it.
Hi,
thank you – i will try it today in a new Blog.
Do you know of a plugin which will help me automatically change my slugs links because I’ve tried SEO post link, SEO slugs and more and can’t get it to do it on auto
The plugins are very nice. They enhance the look of the wordpress. Thanks for the hard work
Thanks ive been wondering how to add these permalinks for ages!
thanks, will use it on my blog
Thanks for this excellent tutorial. Very easy to follow. Many thanks.
This is great news for all blogger using wordpress.
glad to see this tutorial, and ak hope to try it without any problems. thanks
This has great content for using wordpress.which are small functions that helps us to create.Its very easy to follow.
Thanks for this excellent tutorial. Very easy to follow. Many thanks.
A shortcode is a WordPress-specific code that lets you do nifty things with very little effort. Shortcodes can embed files or create objects that would normally require lots of complicated, ugly code in just one line.
Great, simple to follow article!
This looks great. I can’t wait to try it out.
thanks for the permalink shortcodes articles. It help me a lot
Fantastic Work..Hats off!!
i have tweak WP over 6 month..
but i don`t know this before.. thanks for sharing this dude
it`s help me a lot
I got the details about the shot code on word press.This was great article.