Results 1 to 13 of 13
  1. #1
    ABW Ambassador writerguy's Avatar
    Join Date
    January 17th, 2005
    Location
    Springfield, Missouri, USA
    Posts
    3,248
    Using javascript in a WordPress post?
    I know there was talk last week about establishing a WordPress subforum, but until then, I hope it'll be all right to ask a WordPress question here?

    Is there a quick, easy way to display javascript in a WordPress post?

    I have an affiliate marketing site that I'm building with WordPress. It seems to be going all right. BUT -- I tried to add a dynamic full page creative from a Shareasale merchant. It was written in javascript. I put it into the post and it displayed, but the width was way off and there didn't seem any easy way of changing that.

    So I went back to my SAS dashboard and picked up a widget from the same merchant which was the width I needed -- and the widget did not display ANYTHING when I pasted it into my WordPress post instead of using the dynamic FPC.

    So I'm not sure if the widget was coded improperly? I don't know much about WordPress, even less about PHP, and practically nothing about javascript. For all I know, the javascript from the dynamic FPC which did show up may even be something exotically different than the widget, which didn't show up?

    Anybody use javascript in WordPress posts/pages? I searched high and low, far and wide, for a WordPress plugin to insert javascript into WP posts/pages, but found nothing I could figure out.
    Generate more fake news.

  2. #2
    What's the word? Rhia7's Avatar
    Join Date
    January 13th, 2006
    Posts
    9,578
    Javascript In WordPress Posts

    http://www.automateyourbusiness.com/...rdpress-posts/

    I haven't tried it yet, but the site appears to be helpful
    ~Rhia7 -- Remember the 7
    Twitter me

  3. #3
    Visual Artist & ABW Ambassador lostdeviant's Avatar
    Join Date
    September 7th, 2007
    Location
    Cuautitlán, Edo. de México
    Posts
    1,725
    You can't put Javascript in a post without using a plugin.

    I had mentioned this in a previous thread... I really should write an e-book. anyway. What I do is this: I have the Adsense Manager plugin installed. I make a "direct code" ad with the plugin via manage -->ads and I call it widget-affprogram. When I want to later add it to a post I go to the "code" view and select it from the menu that appears.

    If I want the widget in the sidebar I drag the newly formed widget to my sidebar in the presentation--widgets area.

    There are other ways to go about doing this (other plugins), but it works well for me and I no longer have to copy/paste the script if I want to use it for other posts.

  4. #4
    ABW Ambassador simcat's Avatar
    Join Date
    January 18th, 2005
    Location
    Denver
    Posts
    1,786
    I've never had a problem getting adsense to display in a WP post. Plug-in or no plug-in.
    What I could never get to work with Wordpress was cj javascript text ads.

  5. #5
    ABW Ambassador
    Join Date
    June 30th, 2007
    Location
    Syracuse, NY
    Posts
    677
    I had mentioned this in a previous thread...
    That might have been mine. I never was able to get it working though.

    My "fix" was to use Wordpress for the blog, while the rest of my pages are outside Wordpress and created with Wordpad and using standard PHP. Not the most effecient method I'm sure, lol.

    Hopefully Wordpress is nicer to you Gary.

  6. #6
    Visual Artist & ABW Ambassador lostdeviant's Avatar
    Join Date
    September 7th, 2007
    Location
    Cuautitlán, Edo. de México
    Posts
    1,725
    Quote Originally Posted by simcat
    I've never had a problem getting adsense to display in a WP post. Plug-in or no plug-in.
    What I could never get to work with Wordpress was cj javascript text ads.
    I use the plugin for ALL javascript code using the direct ad code option. Just because the plugin is called Adsense Manager doesn't mean you can't think out-of-the-box. :-)

    There are other ways to do it, but this way is very easy, and I do it to save time later because I can call my "ad" from a menu using the code view when writing a new post.

  7. #7
    http and a telephoto
    Join Date
    January 18th, 2005
    Location
    NYC
    Posts
    17,708
    First you need to disable the WYSIWIG visual editor. Sometimes that is all you need. Go to your user page and uncheck the box at the top of the page that says "Use Visual Editor". If that doesn't solve the problem you need to install a plugin that I don't think is downloadable any more, but I will dig out the zip and attach it here. I have widgets, YouTube videos and many other javascript and code in posts that aren't supposed to work
    Deborah Carney
    TeamLoxly.com BookGoodies.com ABCsPlus.com

  8. #8
    ABW Ambassador writerguy's Avatar
    Join Date
    January 17th, 2005
    Location
    Springfield, Missouri, USA
    Posts
    3,248
    Quote Originally Posted by loxly
    If that doesn't solve the problem you need to install a plugin that I don't think is downloadable any more, but I will dig out the zip and attach it here. I have widgets, YouTube videos and many other javascript and code in posts that aren't supposed to work
    Thanks, Deb. Whenever you get a chance, I would love to get the plugin. Yeah, I already had the WYSIWIG editor disabled. I don't normally use it.
    Generate more fake news.

  9. #9
    http and a telephoto
    Join Date
    January 18th, 2005
    Location
    NYC
    Posts
    17,708
    Here ya go! Just unzip, upload to plugins and enable.
    Attached Files Attached Files
    Deborah Carney
    TeamLoxly.com BookGoodies.com ABCsPlus.com

  10. #10
    Visual Artist & ABW Ambassador lostdeviant's Avatar
    Join Date
    September 7th, 2007
    Location
    Cuautitlán, Edo. de México
    Posts
    1,725
    If you use the method I mentioned, you won't need to disable the WYSIWIG editor.

  11. #11
    http and a telephoto
    Join Date
    January 18th, 2005
    Location
    NYC
    Posts
    17,708
    lostdeviant, not everyone will be able to or want to use the Adsense Manager to manage their posts. Alternatives are good to have.
    Deborah Carney
    TeamLoxly.com BookGoodies.com ABCsPlus.com

  12. #12
    Visual Artist & ABW Ambassador lostdeviant's Avatar
    Join Date
    September 7th, 2007
    Location
    Cuautitlán, Edo. de México
    Posts
    1,725
    Quote Originally Posted by loxly
    lostdeviant, not everyone will be able to or want to use the Adsense Manager to manage their posts. Alternatives are good to have.
    Yes, I agree. I also mentioned in my posts that there are different ways to go about it.

    I commented that the method I use doesn't require you to turn off the editor because your post that directly follows mine says to first turn off the editor.

    It gives the impression that it is a requirement for my method or all methods not just the method that you were describing. Not everyone has as much experience as you and they might not realize that it wasn't your intention.

    I thought that it would be good to clarify that it is not necessary to turn off the editor for all methods including the one I use. (nor do you need to use that plugin for your adsense ads. I use it mostly for my javascript based ads and SAS widgets)

  13. #13
    Newbie
    Join Date
    June 26th, 2006
    Posts
    17
    loxly,

    Thank you for posting that plugin! I couldn't figure out why my goldencan search results were not showing up in my wordpress page. Until I was directed to this thread by writerguy from another thread in goldecan forum, big thanks to both of you!

  14. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. Report post button (Wordpress)?
    By tomsko in forum Blogging, Mobile and Social Media
    Replies: 0
    Last Post: October 8th, 2012, 08:51 AM
  2. JavaScript Pagination With POST
    By Uncle Rico in forum Programming / Datafeeds / Tools
    Replies: 1
    Last Post: November 14th, 2009, 04:09 AM
  3. Using javascript in WordPress -- may not be that hard??
    By writerguy in forum Blogging, Mobile and Social Media
    Replies: 1
    Last Post: April 8th, 2008, 06:58 PM
  4. Blogger and probably Wordpress JavaScript fix
    By bobby131313 in forum eBay Partner Network
    Replies: 5
    Last Post: April 8th, 2008, 10:15 AM
  5. Replies: 10
    Last Post: January 18th, 2008, 07:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •