Fixed Comment forms

I love having the comment form in a fixed position in the sidebar but I hate how the complete form doesn’t show if you are viewing the page in a small window. Nathan recently pointed it out and I thought no-one would ever notice until now. I wonder if there is a better solution rather then giving the form a fixed position style.

In the meantime I made the comment field smaller to limit the problem from happening again.

Sidenote: Mint needs a window height pepper.

With that aside:

Simple directions on how I implemented a “floating” comment box on my post pages in K2:

Just updated.

It is also posted here with full code.

About the Author, Dan Cameron:

I'm the owner and solution engineer , a web solutions company that specializes in web development including WordPress.

I started my first blog in 2003 and transitioned to WordPress in 2004. Since moving to WordPress I've written a few plugins and themes for public consumption. Lately I'm busy engineering/building/coding and have only been able to share a few code snippets.

If you're in need of some web development, web design or custom WordPress plugins and/or themes contact me, I'll be happy to discuss it with you.

Read More »

  • http://ruimoura.net/blog Rui Moura

    Really nice. Gonna try it on my blog ;)

  • http://www.eberthmq.com Eberth

    Awesome!!!! i’ll try it on my blog

    tnx :D

  • http://www.eberthmq.com Eberth

    Awesome!!!! i’ll try it on my blog

    tnx :D

  • Pingback: Comment Form at The Real Esteban

  • http://hisyam.com Hisyam

    cool. i actually got it to work a couple of months back but never did publish it since im too lazy to design and create a new layout. Had troubles with IE too. Anyway, Good Job!

  • http://ffxk.com ffxk

    很好啊,�以把摸�共享�

  • http://dancameron.org Dan

    Thanks.

    ffxk: I hope that wasn’t a question.

  • http://dancameron.org Dan

    Thanks.

    ffxk: I hope that wasn’t a question.

  • http://hisyam.com Hisyam

    ok, i know that’s chinese. since i can’t read any.

  • ffxk

    Warning: main(commentform.php): failed to open stream: No such file or directory in /home/worksd1/wp/wp-content/themes/k2/single.php on line 10

    Warning: main(): Failed opening ‘commentform.php’ for inclusion (include_path=’.:/usr/share/pear’) in /home/worksd1/wp/wp-content/themes/k2/single.php on line 10

  • http://ffxk.com ffxk

    2. create a new file called comentform.php and paste the data you cut from the above step into it.

    [?php include("commentform.php"); ?] (replace

    comentform.php or commentform.php

  • http://dancameron.org Dan

    I missplelled it in both places so it doesn’t matter. But as long as the include and the file are the same you can name it whatever you want.

  • ffxk

    Warning: main(commentform.php): failed to open stream: No such file or directory in /home/worksd1/wp/wp-content/themes/k2/single.php on line 10

    Warning: main(): Failed opening ‘commentform.php’ for inclusion (include_path=’.:/usr/share/pear’) in /home/worksd1/wp/wp-content/themes/k2/single.php on line 10

  • http://ffxk.com ffxk

    2. create a new file called comentform.php and paste the data you cut from the above step into it.

    [?php include("commentform.php"); ?] (replace

    comentform.php or commentform.php

  • http://ffxh.com ffxk

    Dan, I’m still waiting you! When will you share your theme to me! I really like it! I’m very glad to acquaintance you!
    The Chinese New Year is coming! Let me to say Happy new year to you! And welcome to China!

  • http://ffxh.com ffxk

    [deleted]
    This is my Email, if you agree with me. Please send it to my email!
    Thank you!

  • http://dancameron.org Dan

    I will save your email.

    I will release the theme when k2 is final.

    check here:
    binarybonsia.com/wordpress/k2/

  • http://freepressblog.org JaredB

    This is getting funny.

  • http://ffxh.com ffxk

    Dan, I’m still waiting you! When will you share your theme to me! I really like it! I’m very glad to acquaintance you!
    The Chinese New Year is coming! Let me to say Happy new year to you! And welcome to China!

  • http://ffxh.com ffxk

    [deleted]
    This is my Email, if you agree with me. Please send it to my email!
    Thank you!

  • http://dancameron.org Dan

    I will save your email.

    I will release the theme when k2 is final.

    check here:
    binarybonsia.com/wordpress/k2/

  • http://ffxh.com ffxk

    Ok! Thanks again, I’ll wait you all the time!

  • http://dancameron.org Dan

    yes it is.

  • http://shuaiking.org/ Shuai King

    Hey, this is a great thingy, thanks!!

  • http://abiertoalanochecer.com jd

    Awesome. Thanxs!!

  • http://abiertoalanochecer.com jd

    I was celebrating too soon. I left a question in the forum.

  • http://abiertoalanochecer.com jd

    Ok, I got it. Apparently there is something missing in the single.php in the latest version of K2. More in the forum.

  • ch0de

    Trying.

  • http://abiertoalanochecer.com jd

    Now I have an issue with the comment text-area not ‘reloading’ after a comment has been inserted. Have any clues??

  • http://idealistfuture.com Jason

    I too have this problem with K2 beta two r163. But it seems to work fine on this site. Dan is working some magic.

  • http://dancameron.org Dan

    No, the same problem happens here. Maybe it’s a browser issue. You know it happens over at Binary as well so it must be something in K2.

  • http://idealistfuture.com Jason

    <a href=”http://binarybonsai.com/forums/comments.php?DiscussionID=152″ rel=”nofollow”> Here is a link to some info about it and a fix for part of the problem.

  • http://www.idealistfuture.com JasonB

    <a href=”http://binarybonsai.com/forums/comments.php?DiscussionID=152″ rel=”nofollow”>the link

  • http://dancameron.org Dan

    I still don’t see the big deal because who wants to comment right after you already left a comment, although you could accidently make a bad link. :D

  • http://idealistfuture.com Jason

    Here is a link to some info about it and a fix for part of the problem.

  • http://www.idealistfuture.com JasonB
  • http://f00kie.com Oleg

    Trying

  • http://www.pixelpolarity.com Kyle

    Hey, I am trying to get it to work with my site. I have got it to float on the right.

    Here’s my problem:
    First, though it is aligned in the correct spot, ti doesn’t stop if it hits another thing in the sidebar, like yours does (It doesn’t overlap Related posts) (http://www.playground.pixelpolarity.com)

    Second, it would be super sweet if you could get this working in conjunction with nybble’s sidebar manager hack.

    Thanks for the help in advance!

  • http://www.pixelpolarity.com Kyle

    Hey, I am trying to get it to work with my site. I have got it to float on the right.

    Here’s my problem:
    First, though it is aligned in the correct spot, ti doesn’t stop if it hits another thing in the sidebar, like yours does (It doesn’t overlap Related posts) (www.playground.pixelpolarity.com)

    Second, it would be super sweet if you could get this working in conjunction with nybble’s sidebar manager hack.

    Thanks for the help in advance!

  • Playground Equipment

    Do you provide a blog feed subscription for this blog so I can get it via email?

  • http://dancameron.org Dan

    <form method=”post” action=”http://www.feedblitz.com/feedblitz.exe?BurnUser”>

    <label for=”email”>Enter your email to subscribe:</label>
    <input name=”email” maxlength=”255″ type=”text” size=”26″ id=”email”></input>
    <input name=”uri” type=”hidden” value=”dancameron”> </input><input type=”submit” value=”Subscribe me!”></input>

    Powered by FeedBlitz

    </form>

  • http://dancameron.org Dan


    Powered by FeedBlitz

  • http://freepressblog.org JaredB

    Why would someone want an e-mail subscription when they could just use RSS?

    Speaking of RSS, you should up the limit on the number of comments in your feed, because right now it’s at 10, and you often get a lot more comments than that per day.

  • http://dancameron.org Dan

    I don’t hink I could change that. Maybe time for a new plugin.

  • http://freepressblog.org JaredB

    No, it just uses the same number as the number of posts per feed, which you can just set in the admin pages interface. You would only have to do something custom if you wanted the count to be different (between comments vs. regular post feeds).

  • Dan

    sweet.

  • http://freepressblog.org JaredB

    Why would someone want an e-mail subscription when they could just use RSS?

    Speaking of RSS, you should up the limit on the number of comments in your feed, because right now it’s at 10, and you often get a lot more comments than that per day.

  • http://www.u2buy.info/code-mp3-music-myspace-player christmas layout myspace

    christmas layout myspace…

    This got me started on a torturous hour of minimally scientific research…