WordPress.org

Ready to get started?Download WordPress

Forums

2 problems, one solution? (9 posts)

  1. JaqueThay
    Member
    Posted 3 years ago #

    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.

    Jaque

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

  3. JaqueThay
    Member
    Posted 3 years ago #

    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.

  4. 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.

  5. JaqueThay
    Member
    Posted 3 years ago #

    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/jaque-thay.com/author/News/wp-content/themes/librarium/single.php on line 26

  6. JaqueThay
    Member
    Posted 3 years ago #

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

  7. 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.

  8. JaqueThay
    Member
    Posted 3 years ago #

    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) [function.call-user-func]: First argument is expected to be a valid callback in /home/pirateba/public_html/jaque-thay.com/author/News/wp-includes/comment-template.php on line 1242

    Fatal error: Call to undefined function comment_form() in /home/pirateba/public_html/jaque-thay.com/author/News/wp-content/themes/librarium/comments.php 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" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Librarium of Jaque Thay - News</title><link href="http://www.jaque-thay.com/author/News/wp-content/themes/librarium/style.css" 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') + '.google-analytics.com/ga.js';    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="http://www.jaque-thay.com/images/NavImages/Portrait.jpg" "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="http://www.jaque-thay.com/Links.php"  class="navBar">Links</a></li>            <li class="navBar"><a href="http://www.jaque-thay.com/Contact.php"  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="http://bayesiantheory.blogspot.com/">Bayesian Theory</a><br/>
    <a href="http://www.playedthat.com">PlayedThat</a><br/>
    <a href="http://www.danielgrosvenor.com">Daniel Grosvenor</a><br/>
    <a href="http://www.supermarketmatters.com">Supermarket Matters</a><br/>
    <a href="http://www.thesprout.co.uk">The Sprout</a></p>
    
    <p>If you would like to be featured on my blogroll then please <a href="http://www.jaque-thay.com/Contact.php">contact me</a></p>
    
    <div id="hr" class="main"></div>
    
    <div><ul id="twitter_update_list"></ul>
    <a href="http://twitter.com/Jaque_Thay" id="twitter-link" style="display:block;text-align:right;">follow me on Twitter</a>
    </div>
    <script type="text/javascript" src="http://twitter.com/javascripts/blogger.js"></script>
    <script type="text/javascript" src="http://twitter.com/statuses/user_timeline/Jaque_Thay.json?callback=twitterCallback2&count=5"></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="http://ws.amazon.co.uk/widgets/q?ServiceVersion=20070822&MarketPlace=GB&ID=V20070822/GB/jaqtha-21/8002/d240af71-a34a-4fd0-b9db-ade70015b3b8"> </SCRIPT> <NOSCRIPT><A HREF="http://ws.amazon.co.uk/widgets/q?ServiceVersion=20070822&MarketPlace=GB&ID=V20070822%2FGB%2Fjaqtha-21%2F8002%2Fd240af71-a34a-4fd0-b9db-ade70015b3b8&Operation=NoScript">Amazon.co.uk 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>
  9. JaqueThay
    Member
    Posted 3 years ago #

    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).

Topic Closed

This topic has been closed to new replies.

About this Topic