January 24, 201115 yr Hello, Sorry about another thread about Wordpress, I have literally search EVERYWHERE for this D: I have a very simple blogging system set up on my website (in sig). It shows the latest blog ive done on the homepage, and then it links to "single.php" to display that blog post. I am now in the process of adding a comments form and comments displayed. However this seems pretty hard to do for some bizare reason - mainly because I dont know whats going on. Can anyone explain to me how comments work in a very simple explanation? And how/what the comments.php file does! Sorry again!
January 24, 201115 yr The files you'll need to edit are: comments.php in /wp-content/themes/your_theme functions.php in the same dir The first file is pretty obvious what needs to be themed, the functions file is not. Find this line in functions.php: function twentyten_comment That function contains the code you should theme for your comment listing. Edited January 24, 201115 yr by andyl
January 24, 201115 yr Author Thanks man, as thats is the comments, do I have to download a plugin for the comment box? (Like name, email etc). Thats the bit thats confusing me the most ! EDIT: <?php comment_form(); ?> Ahh I get what you mean, I found a handy link that says its been changed in 3.0 (which is why I couldnt find much) Edited January 24, 201115 yr by Alias
January 24, 201115 yr Author Well I have the Comment Form sorted I think, but styling the comments is pretty confusing :/
January 24, 201115 yr Well I have the Comment Form sorted I think, but styling the comments is pretty confusing :/ I can't argue with that! Trust me, you get used to it after the 10th time
January 24, 201115 yr Author Haha fair enough, I will just have to trial and error it I suppose :/ Couple more questions... I know you hate me xD 'label_submit' => __('Submit!'), As an argument in the comment_form(). How do I make a image act as the button? The stand html buttons suck And, if you have a form box, you can fill it with text using value, but if someone deletes it, and refreshes the page it still isnt there, but a cashe refresh gets it back. How do I stop this so it appears no matter what on a page refresh.
January 24, 201115 yr Well you'd use CSS of course. I don't really know what you mean with the second part of your post I'm afraid.
January 24, 201115 yr Author Okay: 1) How do I give that label_submit an id though to call in css? 2) http://www.sohtanaka.com/web-design/simple-tabs-w-css-jquery/ Look at that website, and go to the VERY bottom where his contact form is. See how the text is already in the box? and you can delete it, but as soon as you click off it comes back again... Thats what I mean
January 24, 201115 yr How do I give that label_submit an id though to call in css? Load your page and find the HTML code Wordpress has given that submit button. It will have a class by default - just use that. See how the text is already in the box? and you can delete it, but as soon as you click off it comes back again... Thats what I mean You can do that with some extremely simple jQuery (remember to include jQuery on your page): $(document).ready(function(){ $("input").focus(function(){ if ($(this).val() == this.defaultValue) $(this).val(""); }).blur(function(){ if ($(this).val() == '') $(this).val(this.defaultValue); }); }); Edited January 24, 201115 yr by andyl
January 24, 201115 yr Now its time for getting the comments sorted! Oh how Wordpress makes the days fly by...
January 24, 201115 yr Author Haha yep, I downloaded the "Recent Comments" plugin, but im not sure how I will sort the styling out how I want and stuff... I wish there was a simple tutorial on this
January 24, 201115 yr Author Hmm well I am making progress... However im not sure whats going on here: http://elliothesp.co.uk/?p=66 Comments are coming back as errors Warning: call_user_func(twentyten_comment) [function.call-user-func]: First argument is expected to be a valid callback in /home/elliot/public_html/blog/wp-includes/comment-template.php on line 1335 Edited January 24, 201115 yr by Alias
January 24, 201115 yr Hi mate, I see andy got there first regarding what files you need to edit. I have honestly found editing the comments section to be the most difficult part of the whole wordpress site integration so far. I've made a start on my new blog page, but I've only got the comments section half set up so far. Once you start getting into it, it isn't TOO bad, but it took me ages to get started lol
January 24, 201115 yr Author Yeah its proving very hard, I could get away with the above webpage if the comments actually showed up. Whats happened
January 25, 201115 yr Author Found a fix for it: wp_list_comments( array( 'callback' => 'twentyten_comment' ) ); to: wp_list_comments(); in the comments.php file
Create an account or sign in to comment