some help with PHP

milian

Power Member
Joined
Jan 9, 2010
Messages
520
Reaction score
70
I'm trying to put 'share this' on my home page, but on my WP theme it doesn't use a 'page' as the home page but just uses widgets to add content to the home page.

So i put the code for share this in the footer.php file for my theme, but on the home page its bringing up my lastest blog post if you click any of the share this button and not the home page (as the isnt really a 'home page')

so im trying to hack my way through the share this code, adding the correct code to bring up the home page. I've managed to figure out how to bring up the correct title in share this, but i dont know the code to but the home page?

This is what i have so far:

Code:
<span class='st_sharethis_large' st_title='<?php wp_title(); ?>' st_url='<?php [COLOR=Red]??????[/COLOR](); ?>' displayText='share'>
Any one know what i need to add where the red question marks are to make it link to my home page?

Hope that makes sense

cheers
 
Last edited:
right I just added the url without the php syntax and that seemed to work!

Code:
<span class='st_sharethis_large' st_title='<?php wp_title(); ?>' st_url='www.myurl.com' displayText='share'>
 
Good job. :)

For the future, if you want to know how to reference the site, or wordpress URL, just use bloginfo('url') or bloginfo('wpurl')
 
Cheers Crazy, will keep that in mind for the future :)
 
Back
Top