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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.