Jump to content

trouble trying to create a simple function for wordpress


zerojosh

Recommended Posts

???

 

I've been banging my head all night about this... I'm very new to php so please be gentle... (the file names below refer to common wordpress "theme" files, fyi):

 

 

I'm trying to write a function that I can call on various pages to simply auto-generate a hyperlink (essentially for stumbleupon and such). (I've looked at the plug-ins and decided they don't really fit what I'd eventually like to do). Here is the function, located in functions.php:

 

 

function joshtags($perm,$title){
echo '<a href="http://www.stumbleupon.com/submit?url='.$perm.'&title='.$title.'"><img src="icon_su.gif" />Stumble it!</a>';
}  

 

and here is the function being called in single.php:

<?php joshtags(the_permalink(),the_title()); ?>

 

as you can see, it out puts the data but in the wrong order and only partially hyperlinked (with only a partial URL), the output is just below the title of the post at this address: http://www.quantummirage.com/blog/?p=26

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.