Link to Wordpress post
Posted by admin
Here you are a trick that allows to place a html and BB link code to wordpress blog posts - under any post will be generated automticly link code to each entry. It is not a plugin, but it may be done manually, by placing php code in scripts responsible for theme generating.
First of all you have to find file that generate theme for single post - probably it will be single.php or post.php.
Next you have to choose place where link will appear - the bes place is between post content and coments.
And next, place php code that removes the white spaces from wordpress wp_title function. Standardly title is generated with space before title text.
<?php
function af_titledespacer($title) {
return trim($title);
}
add_filter(’wp_title’, ‘af_titledespacer’);
?>
And next, link generation:
html link:
<a href=”<?php the_permalink() ?>” target=”_blank” ><?php wp_title(”,true,”); ?></a>
BB link:
[url=<?php the_permalink() ?>]<?php wp_title(”,true,”); ?>[/url]
Leave a Reply
You must be logged in to post a comment.