Support » Fixing WordPress » 2 problems, one solution?

  • When I built my custom theme I found it no longer allows visitors to leave comments on my blog. I’ve also noticed that although the blog displays the number of comments left (previous to my switching to the custom theme) the public can’t see any of these comments.

    I assume I’ve neglected to include a bit of code for this but not being very code-savvy I don’t know what, or where to find it. If people can help it would be much appreciated.


Viewing 8 replies - 1 through 8 (of 8 total)
  • Christine Rondeau


    Volunteer Forum Moderator

    This is mostly due to the missing <?php comments_template();?> function in your single.php, index.php and archive.php template.

    Thanks Christine. Even this goes a bit beyond me – looking at my ftp software I have an index.php file but no archive.php or single.php file. I can see single.php in the twentyten theme folder – would it work if copied that into the folder for my theme? I can’t see an example of archive.php in the twentyten folder though.

    Christine Rondeau


    Volunteer Forum Moderator

    I thought you said you built a custom theme?

    I can see in your source code, that you have a wp-content/themes/librarium/ folder. Your theme templates should be in there. If they are not, then copy the ones from twentyten and move them in your theme folder.

    I did, following an online guide. I ended up with header, footer, index, sidebar php files and a style sheet. A few files I didn’t create have appeared in the online folder since I uploaded the theme (I assume they were automatically generated). I’ve copied the files archive.php archives.php and single.php into the librarium folder.

    When I try to access existing comments through the webpage (not the control panel) it now states:

    Fatal error: Call to undefined function twentyten_posted_on() in /home/pirateba/public_html/ on line 26

    There is still no option to post a new comment though – meant to add this before pressing post.

    Christine Rondeau


    Volunteer Forum Moderator

    Sorry, I guess that’s not going to work. I forgot that twentyten has a bunch of extra functions in those files. So you’ll have to delete these… so sorry…

    In your index.php there should be a function called <?php comments_template();?>. If it’s not there, you should add it in there.

    I added that line in what looked like the right place. Error message when retrieving old comments is now:

    Warning: call_user_func(twentyten_comment) []: First argument is expected to be a valid callback in /home/pirateba/public_html/ on line 1242

    Fatal error: Call to undefined function comment_form() in /home/pirateba/public_html/ on line 77

    I’ll post the contents of the index.php file here. Looks like my header/footer/sidebar files are all duplicates of this for some reason.

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""><html xmlns=""><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Librarium of Jaque Thay - News</title><link href="" rel="stylesheet" type="text/css" /><!--[if IE]><style type="text/css"> /* place css fixes for all versions of IE in this conditional comment */.twoColLiqRtHdr #sidebar1 { padding-top: 30px; }#mainContent { zoom: 1; padding-top: 15px; }/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */</style><![endif]--><script type="text/javascript">  var _gaq = _gaq || [];  _gaq.push(['_setAccount', 'UA-18704033-1']);  _gaq.push(['_trackPageview']);  (function() {    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '';    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);  })();</script></head><body>	<div id="header">    <div id="width">    	<div id="headerTitle">    		<h1>Librarium of Jaque Thay</h1>    	</div>        <img class="header" src="" "alt="" width="164" height="200" />	</div> 	</div>    	<div id="navbar">    <div id="width">      <ul class="navBar">			<li class="navBar"><a href="../Author.php"  class="navBar">Jaque Thay: Author</a></li>			<li class="navBar"><a href="../Store.php"  class="navBar">Store</a></li>			<li class="navBar"><span class="navBar">News & Updates</span></li>			<li class="navBar"><a href="../Appearances.php"  class="navBar">Appearances</a></li>            <li class="navBar"><a href="../About.php"  class="navBar">About Jaque</a></li>            <li class="navBar"><a href=""  class="navBar">Links</a></li>            <li class="navBar"><a href=""  class="navBar">Contact Me</a></li>		</ul>	</div>	</div> <div id="mainPageContainer">	<div id="width">    <div id="blogSidebar">            	<div id="hr" class="sidebar"></div>            <p>Other blogs you should read</p>
    <p><a href="">Bayesian Theory</a><br/>
    <a href="">PlayedThat</a><br/>
    <a href="">Daniel Grosvenor</a><br/>
    <a href="">Supermarket Matters</a><br/>
    <a href="">The Sprout</a></p>
    <p>If you would like to be featured on my blogroll then please <a href="">contact me</a></p>
    <div id="hr" class="main"></div>
    <div><ul id="twitter_update_list"></ul>
    <a href="" id="twitter-link" style="display:block;text-align:right;">follow me on Twitter</a>
    <script type="text/javascript" src=""></script>
    <script type="text/javascript" src=""></script>
    <div id="hr" class="main"></div>
    <p>If you want to buy a book I've reviewed - or you just want to help me out, I get a small commission on sales through this widget. Cheers!</p>
    <SCRIPT charset="utf-8" type="text/javascript" src=""> </SCRIPT> <NOSCRIPT><A HREF=""> Widgets</A></NOSCRIPT>    	</div>   		 <div id="mainContent">   		   <h2>News and updates</h2><div id="hr" class="main"></div>                	<div id="content" class="narrowcolumn" role="main">	<?php if (have_posts()) : ?>		<?php while (have_posts()) : the_post(); ?>			<div <?php post_class() ?> id="post-<?php the_ID(); ?>">				<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>				<div class="entry">					<?php the_content('Read the rest of this entry &raquo;'); ?>				</div>				<?php the_time('d/m/Y') ?> | <?php comments_popup_link('Comments (0)', '1 Comment »', '% Comments »'); ?>			</div>	<hr>		<?php endwhile; ?>		<div class="navigation">			<div class="alignleft"><?php next_posts_link('&laquo; Older Entries') ?></div>			<div class="alignright"><?php previous_posts_link('Newer Entries &raquo;') ?></div>		</div>	<?php else : ?>		<h2 class="center">Not Found</h2>		<p class="center">Sorry, but you are looking for something that isn't here.</p>		<?php get_search_form(); ?>	<?php endif; ?>	<?php comments_template();?></div></div>        </a><br class="clearfloat" />      </div>    </div>    </div>    <div id="footer">    <div id="width">    	<h4>©   2009-2010 Jaque Thay. No works may be reproduced without permission. </h4>    </div>    </div></div></body></html>

    Note, the new error code came after deleting the uneeded files. With them, the error code was the same as before. I’ve included a link to one of the comments so you can see how it displays at present (error and all).

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘2 problems, one solution?’ is closed to new replies.