Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7541581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T07:55:53+00:00 2026-05-30T07:55:53+00:00

I am trying to hide a comment form on my wordpress blog (although the

  • 0

I am trying to hide a comment form on my wordpress blog (although the page isn’t the wordpress blog, I just get the posts).

If I have comments then the hide/show will work for the form and for the comments. If I have no comments the function doesn’t work and i’m not sure why.

If anybody can help I can upload the php files that show the posts (blog.php) and the comments page (comments.php) that is generated within the wordpress theme.

EDIT: PHP code removed as not relevant to error. Relevant HTML code as follows:

...
<body class="home blog logged-in custom-background">
<script type="text/javascript">
   jQuery(document).ready(function() {
      jQuery("#content img").addClass("imageSeven");
   });
</script>

...

<a id="replytitle" href="javascript:togglecommentform('replyform17');">Show Comment Form</a>
<div id="replyform17" style="display:block;">
   ...
</div>

...

<a id="replytitle" href="javascript:togglecommentform('replyform6');">Show Comment Form</a>
<div id="replyform6" style="display:block;">
   ...
</div>

...
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T07:55:54+00:00Added an answer on May 30, 2026 at 7:55 am

    You have a problem, in that the output (view source) has a reference to jQuery right at the top:

    <body class="home blog logged-in custom-background">
    <script type="text/javascript">
        jQuery(document).ready(function() {
           jQuery("#content img").addClass("imageSeven");
        });
     </script>
    

    Some points on this:

    1. Because you don’t include a reference to jQuery anywhere – this will cause an error, meaning that even if the rest of you JavaScript is valid, it will fail to run.
    2. You don’t need jQuery(document).ready... if you move all your JavaScript to the bottom of the page (just before the </body> end tag.)

    Your main problem seems to be a confused code structure. Based on the messy code you have (no offense), I would recommend using a library like jQuery:


    Step 1: Remove all the JavaScript you have in that page.

    By the looks of things, that just means the <script> block thats right beneath your <body> tag.

    Step 2: Replace these <a> start tags:

    <a id="replytitle" href="javascript:togglecommentform('replyform17');">
    <a id="replytitle" href="javascript:togglecommentform('replyform6');">
    

    With these:

    <a id="replytitle17" href="#">
    <a id="replytitle6" href="#">
    

    Step 3: Just before the </body> tag, include the following:

        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
        <script>
           var images = $('#content img');
           if (images.length > 0) { images.addClass("imageSeven"); }
           $('#replytitle17').click(function() { $('#replyform17').toggle(); });
           $('#replytitle6').click(function() { $('#replyform6').toggle(); });
        </script>
    

    This should achieve everything your page has, in jQuery.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to display a reply form for each comment but I hide the
Just trying to get the (.portfoliocategs) category menu on this site to have a
I am trying to hide some divs before the user prints this giant form,
I'm trying to hide window after its startup. I have own window-class which is
I'm trying to have a comment input field that will show the submit button
http://jsfiddle.net/2CkKW/5/ I'm trying to have a button for comments in which you will press
I am trying to hide a result div. Modify it. Then Show it with
Trying to show/hide severals divs using jquery after each news on my page. <div
Trying to hide the <p class = hide> elements, then fade them in by
I have a working Ajax form, now I'm trying to add file upload to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.