• Resolved bethany138

    (@bethany138)


    Here is the site

    I have customized a jquery popup comment form using fancybox (not the plugin). Everything seems to work fine except when you click the “post a comment” link from any post in the index it always assigns the comment to the first post instead. I am a php novice but can understand enough to implement any fixes you guys can come up with.

    I tried wp-reset-query with no luck. I would think because the index doesn’t use a query? I am thinking the solution would be to reset the post id somewhere?

    Thanks so much for any help you can give. Pulling my hair out here.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter bethany138

    (@bethany138)

    I guess the php would help. : )

    [Code moderated as per the Forum Rules. Please use the pastebin]

    Thread Starter bethany138

    (@bethany138)

    Sorry about that.

    I figured it out and I just thought I would post back here and let you know what I did in case someone has a similar problem.

    I needed to create a conditional element ?? in order to pull the post id into the css id. Or something. It worked.

    This is the code.

    The link to the form:

    <?php if ( is_home() ) : ?>
    <span class="commentslink">Comment <a class="commentspop" href="#commentsform-<?php the_ID(); ?>">on this post</a></span>
    <?php else : ?>
    <span class="commentslink">Comment <a class="commentspop" href="#commentsform">on this post</a></span>
    <?php endif; ?>

    The beginning of the form code:

    <div  style="display: none;">
        <?php if ( is_home() ) : ?>
    <div id="commentsform-<?php the_ID(); ?>" class="commentsformhome">
    <?php else : ?>
    <div id="commentsform">
    <?php endif; ?>
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Comments going to wrong post. Post id reset?’ is closed to new replies.