Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Center area post/pages » Comments, trackbacks & pings »

[SOLVED] How to style the comments title


  #1  
Old Jan 14, 2010, 04:56 AM
ahc
 
38 posts · May 2009
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  
Old Jan 27, 2010, 02:04 AM
Zona
 
30 posts · Jan 2010
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  
Old Jan 27, 2010, 06:11 AM
juggledad's Avatar
juggledad
 
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  
Old Jan 27, 2010, 03:34 PM
Zona
 
30 posts · Jan 2010
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  
Old Jan 28, 2010, 10:42 PM
pakacil
 
20 posts · Jan 2010
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 10:46 PM.
  #6  
Old Jan 29, 2010, 07:20 AM
juggledad's Avatar
juggledad
 
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  
Old Jan 29, 2010, 09:21 PM
pakacil
 
20 posts · Jan 2010
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  
Old Jan 31, 2010, 05:48 PM
Zona
 
30 posts · Jan 2010
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 02:32 AM.
  #9  
Old Feb 3, 2010, 11:57 PM
Zona
 
30 posts · Jan 2010
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  
Old Feb 4, 2010, 04:36 AM
juggledad's Avatar
juggledad
 
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
  #11  
Old Feb 4, 2010, 03:32 PM
Zona
 
30 posts · Jan 2010
When I open Editor>comments.php I see this in my browser's url:

http://vegansprout.com/wp-admin/them...heme=Atahualpa

Thanks JD
  #12  
Old Feb 4, 2010, 05:26 PM
juggledad's Avatar
juggledad
 
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  
Old Feb 4, 2010, 08:44 PM
Zona
 
30 posts · Jan 2010
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  
Old Feb 5, 2010, 05:31 AM
juggledad's Avatar
juggledad
 
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  
Old Feb 5, 2010, 08:10 PM
Zona
 
30 posts · Jan 2010
Beautiful JD! I deleted the line -- your instructions worked perfectly.
Thank you again and again and again.

All the best, Zona

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Own style for link in widget title timdevogel Sidebars & Widgets 10 Jan 5, 2010 04:12 AM
How to style font size in comments? paulae Comments, trackbacks & pings 1 Sep 26, 2009 05:19 PM
[SOLVED] Sidebar widgets title style vishvadeep Sidebars & Widgets 1 Aug 18, 2009 05:21 PM
Change Widget title type size/style rickinesc Atahualpa 3 Wordpress theme 3 Jul 24, 2009 01:57 PM
Change Post title type size/style rickinesc Atahualpa 3 Wordpress theme 1 Jul 14, 2009 02:14 PM


All times are GMT -6. The time now is 07:06 AM.


Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.