Forums

Having Problems Posting a script in a Blog Post (10 posts)

  1. JoleneSugarbaker
    Member
    Posted 3 years ago #

    Hello All!

    I am trying to get a piece of code to post in one of my blog posts. It doesn't show up at all when you just add it to a post. I even use the CODE push button.
    Is it even possible for it to work?
    How would I edit it to make it work?

    The code is as follows:

    <script language="javascript"><!--
    cafepress_keyword_set = "sports";
    cafepress_default_keyword = "";
    cafepress_shuffle = "true"; // ("true" or "false")
    // cafepress_bordercolor="";
    // cafepress_textcolor="";
    // cafepress_textcolor2="";
    // cafepress_bgcolor=""
    // cafepress_bgcolor2="";
    // cafepress_linkcolor="";
    cafepress_target_path = "default";
    cafepress_campaign_id = "";
    cafepress_optimize_ok = "yes";
    cafepress_format_type = "all";
    cafepress_adspace_id = "4132-21530-232-160-160";
    //--></script>
    <script type="text/javascript" src="http://promo.cafepress.com/ad.js"></script>

  2. vkaryl
    Member
    Posted 3 years ago #

    If you're using the wysiwyg editor, it will strip your code out. Disable it (in your user page near the bottom), and try again.

  3. JoleneSugarbaker
    Member
    Posted 3 years ago #

    Maybe i'm a little slow, but :)
    I guess I use what your referring to as the WYSIWYG (post screen).. However, I have never found a way of "Turning" that off, and what is left when that is turned off?
    I also haven't upgraded yet to the newest (dec?) wordpress

  4. vkaryl
    Member
    Posted 3 years ago #

    In wp-admin/users, your profile, near the bottom, at the left:

    Personal Options

    Use the visual rich editor when writing

    uncheck the box.

    What's left is just like what there is in 1.5.2 - a text entry field.

  5. JoleneSugarbaker
    Member
    Posted 3 years ago #

    My version of Wordpress is:
    1.5.1.3

    Which I assume a good course is to upgrade, but then if it reverts back to what i'm using now technically, it might not post then??!?

  6. JoleneSugarbaker
    Member
    Posted 3 years ago #

    Anyone know how this would work? :)

  7. vkaryl
    Member
    Posted 3 years ago #

    Hmm. Well, if your version is that old, you should upgrade at least to 1.5.2. And since your version is that old, you don't HAVE the wysiwyg (which is a 2.0+ thing). So I'm not sure why your code isn't working.

    Try using a plain text editor to insert the js. And you might need to surround the actual script in CDATA tags. In fact, try this:

    <script language="javascript">
    //<![CDATA[
    <!--
    cafepress_keyword_set = "sports";
    cafepress_default_keyword = "";
    cafepress_shuffle = "true"; // ("true" or "false")
    // cafepress_bordercolor="";
    // cafepress_textcolor="";
    // cafepress_textcolor2="";
    // cafepress_bgcolor=""
    // cafepress_bgcolor2="";
    // cafepress_linkcolor="";
    cafepress_target_path = "default";
    cafepress_campaign_id = "";
    cafepress_optimize_ok = "yes";
    cafepress_format_type = "all";
    cafepress_adspace_id = "4132-21530-232-160-160";
    //-->
    //]]>
    </script>
    <script type="text/javascript" src="http://promo.cafepress.com/ad.js"></script>

  8. JoleneSugarbaker
    Member
    Posted 3 years ago #

    Hmmm
    This didn't work either.
    I do thank you for your help :)

    It's been driving a few of us nuts that have wordpress, trying to get these to work.

    Someone said a retooled Adsense plugin would make it work... Still not sure..

    But would still be nice to be able to cut and paste them into posts :)

    I did try the upgrade to 2.0,, it was scary, I have to admit I didn't like the new interface, and things felt cold. Then, I messed up my website trying to revert back, luckily had a back up copy.

  9. Rashunda
    Member
    Posted 3 years ago #

    Hi Jolene,

    Stick with 2.0!:-) Seriously, I thought the same thing at first but now I love it. It's more intuitive than what you think.

    Have you tried blockquoting the code?

  10. JoleneSugarbaker
    Member
    Posted 3 years ago #

    Rashunda, Yes, have used the block quote function, as well as the above suggested CDATA tags.

    Many of us tried to use the above scripts in the actual posts, but end up with nothing appearing at all.

    Hmm, as for 2.0, I'm sure i'll come around sometime on it... but for now, hmm, not ready to make that leap until I know it keeps working... LOL

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags