• Hi, new to WordPress, have question.

    I’ve been doing a site for a client, where we are using Objecty to present various forms of video clips. The site uses WP 2.6. The client wants to have the vid-clip object centered in the viewport, but the body text that may or may not accompany the clip left aligned. No problem, I’ll just wrap the object tag within a div, give it a class to style it center aligned, and Bob’s your daddy. Uncle. Whatever.

    So I thought anyway.

    Turns out that if I do this, in the HTML view, add something like the following:
    <div class="centered"><object class="ObjectyMe" uri="clips/clip.type" width="blah" height="bleh"></object></div>
    Then preview the post and see that it’s not working (no vid is visible), so you backtrack to the post and see that it’s no wonder the vid isn’t playing – your nice code has been transformed into the standard object code for whatever file format the clip is. The ObjectyMe class (which is required for the Objecty script to recognize and process the object contents) is gone.

    I get it, there’s probably some strip tag function at work, but where..?

    I’ve temporarily worked around the problem by instructing the client to just add the object tag in all its Objecty glory, without wrapping it in a div or other container. This obviously places it in a text paragraph and text for the main container is left aligned… Bugger.

    Loooong story short: what must I do to be able to wrap the object in a div? All suggestions are welcome. Truly useful suggestions are loved. Might even get a cookie.

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You could try styling object class=”ObjectyMe” in your style.css so that no added code is needed in the post.

    Thread Starter frdk1

    (@frdk1)

    Thanks for responding, iridiax. It was the first thing I tried, but the thing is this: when entered “naked”, the object tag is wrapped in <p> tags, so any styling of the object tag or the ObjectyMe class gets overridden by the parent container’s paragraph styling. Stuff like auto margins or other centering tricks simply don’t stick.
    The other problem is that in the default state, when wrapping the object tag in a div, the manually entered code gets altered. I can understand that it’s a security measure, to prevent malicious code to be entered, but it also causes problems. I’m trying a few workarounds, but… Other suggestions?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Problems adding object tag in HTML view’ is closed to new replies.