|
#1
Jan 14, 2010, 05:56 AM
|
|
How to style the comments title, putting the post's name in italic, for example? I mean: 1 comment to <em>the post title in italic</em> . Thanks
|
#2
Jan 27, 2010, 03:04 AM
|
|
I'm having the same problem... Under the post (on the post page) I get the line "1 comment to [name of post]" followed by the comment that has been posted. I would like to change the text and formatting of this line.
Where does one do this?
Any advice is appreciated.
Thanks, Zona
|
#3
Jan 27, 2010, 07:11 AM
|
|
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
edit comments.php and change line 22 (version 3.4.5)
HTML Code:
echo get_the_title() ?></h3>
to
HTML Code:
echo '<i>'.get_the_title().'</i>'; ?></h3>
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
|
#4
Jan 27, 2010, 04:34 PM
|
|
JD: Thanks for the reply. I tried editing comments.php with the text you gave me and I got the following where the phrase "1 comment to [name of post]" appeared:
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/thevega4/public_html/wp-content/themes/atahualpa/comments.php on line 24
I'm actually running Atahualpa 3.4.4 and the line you describe as 22 seems to be line 24 in this version given what came up in the error message.
Here is what I see in the preceding lines in my comments.php:
// You can start editing below:
?>
<?php // If there are any comments
if ( have_comments() ) : ?>
<a name="comments"></a><!-- named anchor for skip links -->
<h3 id="comments"><?php // Comment Area Title
comments_number(__('No comments yet to ', 'atahualpa'),
__('1 comment to ', 'atahualpa'), __('% comments to ', 'atahualpa'));
echo get_the_title(); ?></h3>
<?php bfa_next_previous_comments_links('Above'); ?>
I'd like the phrase on my blog to read:
[comment icon] comments (# of comments)
Any other ideas about how to possibly make this change?
Many thanks, Zona
|
#5
Jan 28, 2010, 11:42 PM
|
|
I tried to edit comments.php (line 19-22) and make change :
from...
HTML Code:
<h3 id="comments"><?php // Comment Area Title
comments_number(__('No comments yet to ', 'atahualpa'),
__('1 comment to ', 'atahualpa'), __('% comments to ', 'atahualpa'));
echo get_the_title(); ?></h3>
to...
HTML Code:
<h3 id="comments"><?php // Comment Area Title
comments_number(__('No comments yet to ', 'atahualpa'),
__('1 comment to ', 'atahualpa'), __('% comments to ', 'atahualpa'));?>
<em><?php echo get_the_title(); ?></em></h3>
it works like you want: 1 comment to the post title
is it a right php coding technique or not? I don't know but it works
tried with:
• WordPress 2.9.1
• Atahualpa 3.4.5.1
• Local ( offline)
Last edited by pakacil; Jan 28, 2010 at 11:46 PM.
|
#6
Jan 29, 2010, 08:20 AM
|
|
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
pakacil,
HTML Code:
<em><?php echo get_the_title(); ?></em></h3>
will work the same as
HTML Code:
<?php echo '<em>'.get_the_title().'</em>'; ?></h3>
or
HTML Code:
<?php echo '<em>'.get_the_title().'</em></h3>'; ?>
it all has to do with knowing if you are putting the HTML inside or outside the <?php.......?>
If you are inside, use the ECHO and put the HTML in quotes, if you are outside, just put the HTML up.
Zona,
if I understand what you want, change the code to this
HTML Code:
<?php // If there are any comments
if ( have_comments() ) : ?>
<a name="comments"></a><!-- named anchor for skip links -->
<h3 id="comments"><?php // Comment Area Title
comments_number(__('No comments yet to ', 'atahualpa'),
__('comments (1) ', 'atahualpa'), __('comments(%) ', 'atahualpa'));
echo get_the_title(); ?></h3>
<?php bfa_next_previous_comments_links('Above'); ?>
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
|
#7
Jan 29, 2010, 10:21 PM
|
|
Quote:
Originally Posted by juggledad
it all has to do with knowing if you are putting the HTML inside or outside the <?php.......?>
If you are inside, use the ECHO and put the HTML in quotes, if you are outside, just put the HTML up.
|
thanks juggledad...
now I know, why I messed-up mine when insert some custome code inside. I always missed the quotes.
because, even with very minimal skill, i just want to try and try
|
#8
Jan 31, 2010, 06:48 PM
|
|
Thanks for the coding Juggledad. When I use your new coding I see the following:
"comments (#) [post title]"
This appears for any comment number 1 or more... when there are no comments nothing appears.
This looks good. I'd like to additionally remove the title. How would I code for that? Would something like this work?:
<?php // If there are any comments
if ( have_comments() ) : ?>
<a name="comments"></a><!-- named anchor for skip links -->
<h3 id="comments"><?php // Comment Area Title
comments_number(__('comments (1) ', 'atahualpa'), __('comments(%) ', 'atahualpa')); ?></h3>
<?php bfa_next_previous_comments_links('Above'); ?>
Many many thanks for all your help!
Last edited by Zona; Feb 1, 2010 at 03:32 AM.
|
#9
Feb 4, 2010, 12:57 AM
|
|
I've decided to take the "comment title" line out all together. How do I do that?
I tried deleting the entire section below from comments.php but that didn't work:
<?php // If there are any comments
if ( have_comments() ) : ?>
<a name="comments"></a><!-- named anchor for skip links -->
<h3 id="comments"><?php // Comment Area Title
comments_number(__('No comments yet to ', 'atahualpa'),
__('1 comment to ', 'atahualpa'), __('% comments to ', 'atahualpa'));
echo get_the_title(); ?></h3>
Anyone have ideas? Thanks, Zona
|
#10
Feb 4, 2010, 05:36 AM
|
|
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
Zona, what is your url pointing to an example. I just want to make sure we are talking about the same commens area?
What version of Atahualpa and WP?
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
|
#12
Feb 4, 2010, 06:26 PM
|
|
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
sorry, let me rephrase (I just reread what I wrote and see how it could be misread)
Please list athe URL of one of your pages in your blog. Then tell me where on that page I can see the word Comment' that you want to change.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
|
#13
Feb 4, 2010, 09:44 PM
|
|
Hi JD:
Here you go is the page:
http://vegansprout.com/?p=432
This line only appears on the PAGE VIEW of a post and ONLY if there are COMMENTS. As my blog is new and I have no comments ... yet, I put in a test comment to the post "Mushroom Barley Soup."
The line I am referring to is below the post after the line: "| Category: Soups | One comment [comment gif]"
It reads:
"1 comment to [Blog title]"
Thank you for the help!
|
#14
Feb 5, 2010, 06:31 AM
|
|
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
Ahhh this is the problem of multiple people posting in the same thread at the same time about what seems to be the same thing but isn't (wow, that was a mouth full)
If you want to get rid of the line '1 comment to Mushroom Barley Soup' you have to edit comment.php and locate the following lines (19-22 in version 3.4.5.1)
HTML Code:
<h3 id="comments"><?php // Comment Area Title
comments_number(__('No comments yet to ', 'atahualpa'),
__('1 comment to ', 'atahualpa'), __('% comments to ', 'atahualpa'));
echo '<i>'.get_the_title().'</i>'; ?></h3>
and remove them.
If you wanted to change the wording so it read ''Mushroom Barley Soup has 1 comment', you could change that code to this:
HTML Code:
<h3 id="comments"><?php // Comment Area Title
echo '<i>'.get_the_title().'</i> has ';
comments_number(__('No comments yet to ', 'atahualpa'),
__('1 comment', 'atahualpa'), __('% comments', 'atahualpa'));?></h3>
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
|
#15
Feb 5, 2010, 09:10 PM
|
|
Beautiful JD! I deleted the line -- your instructions worked perfectly.
Thank you again and again and again.
All the best, Zona
|
|