1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

some help with PHP

Discussion in 'Web Design' started by milian, Sep 13, 2011.

  1. milian

    milian Power Member

    Joined:
    Jan 9, 2010
    Messages:
    515
    Likes Received:
    69
    Occupation:
    SEO stuff
    Location:
    Around
    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: Sep 13, 2011
  2. milian

    milian Power Member

    Joined:
    Jan 9, 2010
    Messages:
    515
    Likes Received:
    69
    Occupation:
    SEO stuff
    Location:
    Around
    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'>
     
  3. Crazy

    Crazy Jr. Executive VIP

    Joined:
    Jun 13, 2009
    Messages:
    640
    Likes Received:
    319
    Occupation:
    VB, C#, XHTML, CSS, PHP, MySQL, JavaScript, jQuery
    Location:
    Everywhere
    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')
     
    • Thanks Thanks x 1
  4. milian

    milian Power Member

    Joined:
    Jan 9, 2010
    Messages:
    515
    Likes Received:
    69
    Occupation:
    SEO stuff
    Location:
    Around
    Cheers Crazy, will keep that in mind for the future :)