zerojosh Posted February 17, 2007 Share Posted February 17, 2007 ??? 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 Quote Link to comment https://forums.phpfreaks.com/topic/38945-trouble-trying-to-create-a-simple-function-for-wordpress/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.