Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Wordpress Comments

Featured Replies

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!

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 by andyl

  • 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) :p

Edited by Alias

  • Author

Well I have the Comment Form sorted I think, but styling the comments is pretty confusing :/

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

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

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.

  • 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 :p

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 :p

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 by andyl

  • Author

Thank you very much :)

 

Now its time for getting the comments sorted! :p

  • 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 :(

  • 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 by Alias

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

  • Author

Yeah its proving very hard, I could get away with the above webpage if the comments actually showed up.

 

Whats happened :(

  • Author

Found a fix for it:

 

wp_list_comments( array( 'callback' => 'twentyten_comment' ) );

 

to:

 

wp_list_comments();

 

in the comments.php file :D

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.