Easy 5 dollars if you can answer this....

18 replies
I will paypal 5 dollars to the first warrior
who can (reasonably) resolve this.............


Summary:

WordPress: Click FB Like Button: How to load new WP page.?


I'm able to get a working Facebook Like button
in a WordPress blog post, using the code shown below.
(which I got from here) Works great,
I can click to Like, Unlike, and Like again.

Now, I'd like to have a new WordPress page load
upon clicking the Like button. Thinks I tried:
  • tried wrapping the iframe code in <a> tags
  • tried inserting an <a> tag between the opening & closing iframe tag
  • tried adding OnClick in iframe tag's options

I'm looking for a simple solution (for example one of the items
that I tried above), and do *not* want a long, involved solution.
(for example I don't want a solution involving loading js libraries
then adding code and widgets to files, etc)

Anyone have any ideas?

The first post that contains a simple, do-able
solution will get 5 fungolas delivered to their Paypal account : - )

I prefer that you show me a WordPress test page
containing the Like button (sourcecode below) which when clicked,
will accept the Like plus bring user to a new Wordpress page.


Code:
<iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo urlencode(get_permalink()); ?>&amp;layout=standard&amp;show_faces=false&amp; width=450&amp;action=like&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:60px;">
</iframe>
#button #click #load #page #wordpress
  • Profile picture of the author awebforyou
    did you try putting target=_new in the a tag?
    {{ DiscussionBoard.errors[3906028].message }}
    • > did you try putting target=_new in the a tag?

      To clarify, when I tried the 3 bulleted items,
      nothing at all happened when I clicked.

      (btw "_new" wouldn't apply because the new page
      must load in place of the current one)
      {{ DiscussionBoard.errors[3906053].message }}
    • Profile picture of the author andrejvasso
      As awebfor your suggested, target="_blank" should do the job.

      Just like this:

      Code:
      <a href="http://www.facebook.com/plugins/like.php?href=<?php echo urlencode(get_permalink()); ?>&amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=like&amp;colorscheme=light" target="_blank">FB LIKE</a>
      {{ DiscussionBoard.errors[3906067].message }}
      • Originally Posted by awebforyou View Post

        did you try putting target=_new in the a tag?
        Originally Posted by andrejvasso View Post

        As awebfor your suggested, target="_blank" should do the job.
        @awebforyou and @andrejvasso:

        Thanks for those suggestions.
        Just now tried those plus all kinds of variations
        and here's the result:
        <a href=http://google.com> hotword#1 {iframe code for Like button} hotword#2 </a>
        The above will make hotword#1 and hotword#2 into clickable hotlinks, but for some reason the Like button that is smack-dab in between those two hot words, is not hot. Seems as though the Like button doesn't like being wrapped in an A anchor tag.
        {{ DiscussionBoard.errors[3908447].message }}
  • Profile picture of the author awebforyou
    or if it should be in the parent frame then try target="_parent"

    Esther - Web Programmer
    web programmer-eshops-custom database solutions-Awebforyou
    {{ DiscussionBoard.errors[3906216].message }}
  • Profile picture of the author wrongnumber
    Originally Posted by White Dove Creative View Post

    I will paypal 5 dollars to the first warrior
    who can (reasonably) resolve this.............


    Summary:

    WordPress: Click FB Like Button: How to load new WP page.?


    I'm able to get a working Facebook Like button
    in a WordPress blog post, using the code shown below.
    (which I got from here) Works great,
    I can click to Like, Unlike, and Like again.

    Now, I'd like to have a new WordPress page load
    upon clicking the Like button. Thinks I tried:
    • tried wrapping the iframe code in <a> tags
    • tried inserting an <a> tag between the opening & closing iframe tag
    • tried adding OnClick in iframe tag's options

    I'm looking for a simple solution (for example one of the items
    that I tried above), and do *not* want a long, involved solution.
    (for example I don't want a solution involving loading js libraries
    then adding code and widgets to files, etc)

    Anyone have any ideas?

    The first post that contains a simple, do-able
    solution will get 5 fungolas delivered to their Paypal account : - )

    I prefer that you show me a WordPress test page
    containing the Like button (sourcecode below) which when clicked,
    will accept the Like plus bring user to a new Wordpress page.


    Code:
    <iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo urlencode(get_permalink()); ?>&amp;layout=standard&amp;show_faces=false&amp; width=450&amp;action=like&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:60px;">
    </iframe>
    are you looking for something like this ==>> fbguy.co.cc
    {{ DiscussionBoard.errors[3906581].message }}
    • Originally Posted by wrongnumber View Post

      are you looking for something like this ==>> fbguy.co.cc
      thanks, although that solution is for a Facebook iframe page
      with a Like button.

      What I'm needing is a WordPress page
      with a Facebook Like button (which I have working)
      but with a page reveal (the part not yet working)
      {{ DiscussionBoard.errors[3908485].message }}
      • Profile picture of the author SteveJohnson
        Originally Posted by White Dove Creative View Post

        .. > no-code solution to a relatively complicated problem

        First, @SteveJohnson, it's probably not a complicated problem,
        Second, nobody said anything about a no-code solution.
        It is a relatively complicated problem, because the main viewport has no way of detecting a click in an iframe. You have to rely on whatever is supplying the iframe content to send a click event. AFAIK, the only way to do that is by using an FBML like button instead of the iframe button.

        Then you use the FB JavaScript SDK to subscribe to the event that FB fires when a like button is clicked.

        (for example I don't want a solution involving loading js libraries
        then adding code and widgets to files, etc)
        Does this not imply a no-code solution?

        .. > take up even more of their time to set up

        Listen guy, because you obviously don't know how long things take with WordPress... it's best that you refrain from comments on things you aren't familiar with. (hint: took me less than 1 minute to make a test post and click Preview and see that working Like button using the snippet mentioned in my op) Anyone who finds a solution can certainly make the post (to show me) and make the page not appear in their blog. Or post it to a test blog, which most programmers have btw.
        You don't have the first clue how much I know or don't know about WP (hint: It's probably more than you, since I DO know how to do what you want done and you obviously don't). I don't have a 'test blog', sorry. I just run a server on my dev machine to test with, not as sophisticated as a test blog.

        So @SteveJohnson, warriors participate in this forum both to give help, and to ask for it. And yes, even though my programming challenge is probably a quickie for anyone for anyone who knows how to nail it, its okay @SteveJohnson if someone does indeed want to spend longer on it, because hey we're all here to help one another.
        I've been on this board answering questions and helping people for the better part of 4 years now. You want to tell me how the WF works?

        Originally Posted by White Dove Creative View Post

        .. > for five bucks?
        .. > That's a little bit insulting

        @SteveJohnson:

        Actually offering 5 bucks in a free forum is the polar opposite of what you described it as. It's not "insulting" as you say. It's a fun challenge. Don't know whether you have a bug up your @ss today or whether you feel a need to visit threads and exercise some sort of machoism or manly-man-ess to compensate for whatever personal issues are going on in your life. But whatever the case, go do it somewhere else. Now, if you have something to contribute to this thread, or to this forum, we all want to hear from you. Otherwise, we don't.
        Offering a token $5 to someone with the knowledge you don't have IS insulting. You wouldn't go to a doctor and say, "fix me, it's just a little pimple, I'll give you $5." "Oh, and I'd like to see you fix someone else's pimple first."

        I'm trying to get you to understand that what you did was insulting to a lot of professionals. That you may not have known that is understandable, and I probably could have worded it a little differently, but now you know. That you expected someone to both solve your problem AND take extra time to put up a working solution somewhere instead of giving you the code for YOU to play with struck me as terribly arrogant - or ignorant. The ignorant part we just fixed, the arrogant part you'll have to deal with yourself.

        Originally Posted by White Dove Creative View Post

        @awebforyou and @andrejvasso:

        Thanks for those suggestions.
        Just now tried those plus all kinds of variations
        and here's the result:
        <a href=http://google.com> hotword#1 {iframe code for Like button} hotword#2 </a>
        The above will make hotword#1 and hotword#2 into clickable hotlinks, but for some reason the Like button that is smack-dab in between those two hot words, is not hot. Seems as though the Like button doesn't like being wrapped in an A anchor tag.
        Only a border or padding area would be recognized as a click on that link, for the reason given above.

        Originally Posted by White Dove Creative View Post

        thanks, although that solution is for a FB iframe page.

        What I'm needing is the Facebook Like button
        on a WordPress page (which I have working)
        but with a page reveal (the part not yet working)
        You don't want a page reveal, which applies only to FB pages, but a redirect when a like button is clicked.
        Signature

        The 2nd Amendment, 1789 - The Original Homeland Security.

        Gun control means never having to say, "I missed you."

        {{ DiscussionBoard.errors[3908845].message }}
        • .. > That you expected someone to both solve your problem
          .. > AND take extra time to put up a working solution somewhere

          What you still don't get, is the fact that this is a free forum, where professionals are already offering their time and advice for free. Many put in a great deal of their personal time to help other warriors. So if I can buy a fellow warrior a Starbucks, then hey all the merrier. ...On the other hand, if you're comparing my $five offer to those "expert answers" websites that charge $45 to have an expert answer a question, then you gotta keep in mind that WF is not one of those sites. WF is a community. Where we help one another. For free. (and sometimes we get a Starbucks)

          btw my initial posting got near zero reads, and zero replies.
          Which is why I decided to try the 5 dollar incentive.
          (which seemed to wake up the thread)


          .. > since I DO know how to do what you want done
          .. > and you obviously don't)

          Okay, so you know the solution to my issue. Gotcha.
          Regretful that you're the kind of person who would
          keep that info to yourself, rather than have helped me.
          In your initial posting you could have helped me,
          rather than throw out insults.
          {{ DiscussionBoard.errors[3909105].message }}
          • Profile picture of the author SteveJohnson
            Originally Posted by White Dove Creative View Post

            .. >What you still don't get, is the fact that this is a free forum, where professionals are already offering their time and advice for free. Many put in a great deal of their personal time to help other warriors. So if I can buy a fellow warrior a Starbucks, then hey all the merrier. ...On the other hand, if you're comparing my offer to those "expert answers" websites that charge $45 to have an expert answer a question, then you gotta keep in mind that WF is not one of those sites. WF is a community. Where we help one another. For free. (and sometimes we get a Starbucks)
            All right already, I understand where you're coming from. All I was trying to get across is that the way you did it came across as insulting. But let's just drop that, eh?

            And I *DO* get it - like I said (and you can see at the left), I've been here "offering my time and advice for free" since early 2007.

            btw my initial posting got near zero reads, and zero replies.
            Which is why I decided to try the 5 dollar incentive.
            (which seemed to wake up the thread)
            In hindsight, that is reasonable.

            Okay, so you know the solution to my issue. Gotcha.
            Regretful that you're the kind of person who would
            keep that info to yourself, rather than have helped me.
            In your initial posting you could have helped me,
            rather than throw out insults.
            I don't know THE solution - I know ONE solution. And it's not easy, and I couldn't begin to explain it to you so that you could copy or implement it. And I'm sorry, but I don't have the time to set up and test it and show you a working example.

            But here's how you do it:
            • go to Login | Facebook, (that's http:// developers . facebook . com ), log in, click on My Apps, then the Set Up New App button
            • fill in the blanks, register your app, get your API key
            • in the head section of your theme, load and initialize the FB Javascript SDK
            • add an xml namespace declaration to your app address in the opening html tag so that XFBML is recognized
            • add the necessary tags to the head section
            • then you subscribe to the edge.create event through the FB.Event.Subscribe function using a callback function to redirect to the new URL when a visitor clicks the Like button

            Now - I'm in NO WAY meaning this to sound condescending - but do you see how this isn't such an easy simple solution? I'm sorry, and I'm not being sarcastic, but I just don't have the time to code this, test it, then set it up somewhere for you to look at. Hopefully from what I've outlined you'll be able to piece it together.
            Signature

            The 2nd Amendment, 1789 - The Original Homeland Security.

            Gun control means never having to say, "I missed you."

            {{ DiscussionBoard.errors[3909535].message }}
  • Profile picture of the author SteveJohnson
    Originally Posted by White Dove Creative View Post

    I will paypal 5 dollars to the first warrior
    who can (reasonably) resolve this.............


    I'm looking for a simple solution (for example one of the items
    that I tried above), and do *not* want a long, involved solution.
    (for example I don't want a solution involving loading js libraries
    then adding code and widgets to files, etc)

    I prefer that you show me a WordPress test page
    containing the Like button (sourcecode below) which when clicked,
    will accept the Like plus bring user to a new Wordpress page.
    You want (1) a no-code solution to a relatively complicated problem AND (2) whoever helps you to take up even more of their time to set up a demo page so you can see it...

    ...for five bucks?

    That's a little bit insulting, don't you think?
    Signature

    The 2nd Amendment, 1789 - The Original Homeland Security.

    Gun control means never having to say, "I missed you."

    {{ DiscussionBoard.errors[3906863].message }}
    • Originally Posted by SteveJohnson View Post

      You want (1) a no-code solution to a relatively complicated problem AND (2) whoever helps you to take up even more of their time to set up a demo page so you can see it...

      ...for five bucks?

      That's a little bit insulting, don't you think?
      .. > for five bucks?
      .. > That's a little bit insulting

      @SteveJohnson:

      Actually offering 5 bucks in a free forum is the polar opposite of what you described it as. It's not "insulting" as you say. It's a fun challenge. Don't know whether you have a bug up your @ss today or whether you feel a need to visit threads and exercise some sort of machoism or manly-man-ess to compensate for whatever personal issues are going on in your life. But whatever the case, go do it somewhere else. Now, if you have something to contribute to this thread, or to this forum, we all want to hear from you. Otherwise, we don't.
      {{ DiscussionBoard.errors[3908335].message }}
      • .. > no-code solution to a relatively complicated problem

        First, @SteveJohnson, it's probably not a complicated problem.
        Second, nobody said anything about a no-code solution.

        .. > take up even more of their time to set up

        Listen guy, because you obviously don't know how long things take with WordPress... it's best that you refrain from comments on things you aren't familiar with. (hint: took me less than 1 minute to make a test post and click Preview and see that working Like button using the snippet mentioned in my op) Anyone who finds a solution can certainly make the post (to show me) and make the page not appear in their blog. Or post it to a test blog, which most programmers have btw.

        So @SteveJohnson, warriors participate in this forum both to give help, and to ask for it. And yes, even though my programming challenge is probably a quickie for anyone for anyone who knows how to nail it, its okay @SteveJohnson if someone does indeed want to spend longer on it, because hey we're all here to help one another.
        {{ DiscussionBoard.errors[3908350].message }}
  • Profile picture of the author andrejvasso
    Allthough i dont have anything more to contribute, I want to say two more things:

    @White Dove Creative: You should really work on your attitude. Offering 5USD is indeed kinda insulting (if you dont know why, think about it!). And if you want other members to keep helping you, you should stop talking and acting like an asshole.

    @Steve: I really dont understand why you have even tried to help him after the stuff he was saying (he will most likely not understand it anyways lol)! Kudos to you!
    {{ DiscussionBoard.errors[3909707].message }}
    • Profile picture of the author SteveJohnson
      Originally Posted by andrejvasso View Post

      @Steve: I really dont understand why you have even tried to help him after the stuff he was saying (he will most likely not understand it anyways lol)! Kudos to you!
      Thanks. Guess I figured life is too short to be petty
      Signature

      The 2nd Amendment, 1789 - The Original Homeland Security.

      Gun control means never having to say, "I missed you."

      {{ DiscussionBoard.errors[3909779].message }}
      • .. > I don't know THE solution - I know ONE solution.
        .. > And it's not easy, and ... ... But here's how you do it

        Steve, well thanks man for your comments and for your tech suggestion. You're right--that method is way too involved, as I was looking for a much simpler solution.

        It's kinda hard to believe that the Like button appearing on a WordPress page cannot somehow be wrapped in a hot DIV tag or something, or have an extra javascript call added to some part of that Like button html snippet included in my OP. (i.e. javascript loads new page after 3 second delay, then calls the Facebook function) Or maybe adding a javascript onUnclick() or some other creative yet simple solution. (which I'm sure might be out there)
        {{ DiscussionBoard.errors[3910040].message }}
        • Profile picture of the author SteveJohnson
          Originally Posted by White Dove Creative View Post

          .. > I don't know THE solution - I know ONE solution.
          .. > And it's not easy, and ... ... But here's how you do it

          Steve, well thanks man for your comments and for your tech suggestion. You're right--that method is way too involved, as I was looking for a much simpler solution.

          It's kinda hard to believe that the Like button appearing on a WordPress page cannot somehow be wrapped in a hot DIV tag or something, or have an extra javascript call added to some part of that Like button html snippet included in my OP. (i.e. javascript loads new page after 3 second delay, then calls the Facebook function) Or maybe adding a javascript onUnclick() or some other creative yet simple solution. (which I'm sure might be out there)
          The Like button is an iframe. What is IN the iframe isn't connected to or controlled by the parent page. For example, you can't include styles in a stylesheet that would affect what's in the iframe.

          SO - the only part of the iframe that the parent page is 'aware' of is whatever is around the iframe tag - padding, border, etc. Once the cursor moves inside the iframe, the parent page loses contact with it completely.

          The short answer is that you can't accomplish what you want easily.
          Signature

          The 2nd Amendment, 1789 - The Original Homeland Security.

          Gun control means never having to say, "I missed you."

          {{ DiscussionBoard.errors[3910887].message }}
    • Originally Posted by andrejvasso View Post

      @White Dove Creative: You should really work on your attitude. Offering 5USD is indeed kinda insulting (if you dont know why, think about it!).
      Yeah, I do know why. The neighbor helps you change your tire, and you accept that as a kind neighborly gesture and don't offer him money. (just like warriors help each other in this programming forum) But if you tell your neighbor "thank for your help, here's a dollar" then that would insult him. Yeah, I do get that. A better, more eloquent way to show gratitude would be to offer the neighbor a cold beer. (that's probably what @SteveJohnson meant when he said there were better ways for me to make the offer to the warriors) Anyways, I offered five bucks, and it is what it is.

      btw I find it interesting that you say you were insulted by the five bucks, yet you clicked into this thread, plus, you participated to get the five bucks. Just sayin.
      {{ DiscussionBoard.errors[3910115].message }}

Trending Topics