• Resolved momsnet

    (@momsnet)


    We are replacing our old blog community script with WPMU – and are in the beginning testing phases before opening and alerting people.

    We are able to add straight html code in the text widget – such as for an image and having that link to a website, but when we attempt to put in adsense code, or any of the coding form our own advertising script, or any blog exchange code etc, it either disappears from the widget entirely or stays in there but then the coding itself is showing on the blog.

    At first I thought it was some of the themes we have that weren’t tested to be used in WPMU but I also have themes downloaded from WPMUdev.org that are tested to work and the same issue pops up.

    Thanks so much for any insight!

Viewing 8 replies - 1 through 8 (of 8 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    What plugins are you running? I can add html adsense stuff right into my site as widgets without issues.

    Look at the $allowedposttags from wp-includes/kses.php. kses filters the content of the default text widget. If your adsense html tags are not listed in kses.php, then they go “poof” when you save the text widget.

    Thread Starter momsnet

    (@momsnet)

    ipstenu – no plug ins….

    Thanks David – I’m not sure where in there to add what I need… such as <iframe> coding needed and <javascript> for the adsense.

    I found a plugin that overwrites this I guess.. and you are to be able to add it on a site by site basis but that is also becoming a challenge

    Something similar to this snippet added to an “mu-plugin” should allow iframe and its src tags in posts/text widgets, add the rest of the parameters in your code in a similar way.

    <?php
    global $allowedposttags;
    $allowedposttags['iframe'] = array( 'src' => array());
    ?>

    There is a reason iframe and javascript tags are not allowed by strangers sharing your network, and it is a good one.

    I can add html adsense stuff right into my site as widgets without issues.

    Becasue you’re Super Admin on your network. ??

    I found a plugin that overwrites this I guess.. and you are to be able to add it on a site by site basis but that is also becoming a challenge

    If it’s the unfiltered-mu plugin, then Network activate it or stick it in the mu-plugins folder.

    Again, as David said above, please don’t allow these on a network where you’re letting the general public sign up.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    I can add html adsense stuff right into my site as widgets without issues.

    Becasue you’re Super Admin on your network. ??

    ROTFL! Good point. I forgot that mattered.

    Thread Starter momsnet

    (@momsnet)

    Thanks guys – the site by site addition seems to be doing fine in our testing mode.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Text Widget Problem with Adsense & other coding’ is closed to new replies.