WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to create a video plugin which is fixed on the home page when user scrolls. I know there is a wp_float plugin . But I want to try build new plugin

share|improve this question
What is your specific question? – toscho Mar 21 '13 at 10:56

You can achieve this with pure CSS. It's a solid alternative to your question.

Depending if your widget has a unique ID (like id="widget-358" or id="my-video-widget"), you can set up CSS rules to make it float in a fixed position on the screen:

#my-video-widget {
    /* required */
    position: fixed;

    /* change to your needs */
    top: 0px; /* to float it from the bottom of the screen, use the 'bottom' directive */
    left: 0px; /* to float it on the right hand side, use the 'right' directive */

    /* optional */
    z-index: 10; /* depends if elements on your page are already layered, and if you want your video to float above everything else */

If your widget does not have a unique identifier, you may risk affecting other widgets or elements, so I advise you put a unique name in either the class or id (id makes much more sense).

share|improve this answer
Thanks Marc. But this widget will goto footer are the sidebar. where to place the widget? – B L Praveen Mar 26 '13 at 10:42
It doesn't matter where you place the widget code, because the CSS will make it float to where you specify, regardless of the position of the HTML elements in your code. You should try to put a little more effort in making clear what you want if you want people to help you. – Marc Dingena Mar 26 '13 at 14:10

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.