Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End share buttons and wordpress

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #38018
    jmc
    Participant

    I am in the process of establishing my first wordpress theme, and within the post loop, I would like to add some share buttons. I am not entirely certain if this can be achieved, but is there a way to, instead of putting in a static URL for the button (ex. facebook like button), put a line of php that dynamically places the URL of the post the buttons are nested in?

    I was looking into the Share This plugin, but I’m unsure if this would be a viable solution for me.

    any help would be greatly appreciated!

    #102670
    noahgelman
    Participant

    Yes sir, most certainly is possible although I’m not sure if it’s compatible with the Share This link you shared. It looks like their code doesn’t have a spot for the URL. Their code grabs it for you.

    However, if you do find a code where you type in the url it’s very easily done.

    First you grab whatever the current URL is and create a variable:

    and then you add it where a social media code needs it (the following example is a Facebook Comments code):

    #102672
    jmc
    Participant

    the only question I have now is where exactly would I place the first line of code?

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Back End’ is closed to new topics and replies.