Wordpress Themes - WP Forum at BFA
Click Here To DONATE! Support the theme development, get more attention and additional benefits based on your donation level. Your forum name will be highlighted.

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

[SOLVED] Making a separate header for the trackbacks?


Build custom WP THEMES, without
coding.
Click here for THEMEFRAME

From the author of Atahualpa, the #1 most
downloaded (700,000+) theme @ wordpress.org
  #1  
Old Apr 3, 2010, 11:36 PM
jankph
 
92 posts · Jul 2009
ATA 3.6.4 and WP 3.1
While it is great to have trackbacks and pingbacks separated from the rest of the comments, i.e. trackbacks below comments, is there a way to clearly identify them as trackbacks, i.e. with a header that says "trackbacks"?

1. Is it possible to insert a "Trackbacks" header before the trackbacks?

2. Is there a way to make it say "XX comments to ..." and then "YY trackbacks to...", taking into account the different numbers?

3. If neither 1 or 2 are possible, where can I change "XX comments to..." into XX reactions to..." since a trackback is not a comment and it thus makes more sense to call he whole thing reactions rather than comments as to not confuse the readers.

Thanks for your help.

Edit:
I managed to figure out #3 but I would also like #1 to work, #2 would be better, though.

Last edited by jankph; Apr 4, 2010 at 01:17 AM.
  #2  
Old Apr 8, 2010, 03:06 PM
jankph
 
92 posts · Jul 2009
ATA 3.6.4 and WP 3.1
Just bumping my own thread here.

What I am looking for is a way to insert "Trackback" above the trackbacks/pingbacks. Right now it's like this below the post, e.g.

6 reactions to post title
comment 1
reply 1
comment 2
reply 2
trackback 1
trackback 2


I want it to be

6 reactions to post title
comments
comment 1
reply 1
comment 2
reply 2
trackbacks
trackback 1
trackback 2


It should be very simple, just inserting a line of text somewhere in the php, but where?


Ideally, it should be

4 comments to post title
comment 1
reply 1
comment 2
reply 2
2 trackbacks to post title
trackback 1
trackback 2


How can I make that?
  #3  
Old Jan 10, 2011, 11:03 PM
derekwbeck
 
151 posts · Nov 2010
In the comments.php, which you can find in the editor option in WP underneath the ATA options, find the code

Code:
		wp_list_comments(array(
			'avatar_size'=>$bfa_ata['avatar_size'],
			'reply_text'=>__(' · Reply','atahualpa'),
			'login_text'=>__('Log in to Reply','atahualpa'),
			'callback' => bfa_comments, 
			'type' => 'comment'
			));

		wp_list_comments(array(
			'avatar_size'=>$bfa_ata['avatar_size'],
			'reply_text'=>__(' · Reply','atahualpa'),
			'login_text'=>__('Log in to Reply','atahualpa'),
			'callback' => bfa_comments, 
			'type' => 'pings'
			));
and insert between the two the following:

Code:
		echo "any HTML or text here, such as Trackbacks";
that will do it. Be sure to keep a local copy of this add-in, as it may be replaced with future upgrades of the ATA theme.

Note, this assumes you have, in the ATA>Comments settings, comments set up to separate trackbacks/pingbacks out.

derek
www.1775thebook.com

Last edited by derekwbeck; Jan 10, 2011 at 11:04 PM. Reason: typo
  #4  
Old Jan 11, 2011, 12:13 AM
derekwbeck
 
151 posts · Nov 2010
Okay, I've been toying with this on my own site, and following the suggestions of http://wphacks.com/separating-trackb...wordpress-2-7/

here's what I did (using ATA 3.5.3 and WP 3.0.4):

In the comments.php as noted above, I removed the above code, and replaced it with:

Code:
	<?php // Do this for every comment
	if ($bfa_ata['separate_trackbacks'] == "Yes") {

		//add-in by derek beck for 
		//from www.wphacks.com/separating-trackbacks-from-comments-in-wordpress-2-7/

		wp_list_comments(array(
			'avatar_size'=>$bfa_ata['avatar_size'],
			'reply_text'=>__(' &middot; Reply','atahualpa'),
			'login_text'=>__('Log in to Reply','atahualpa'),
			'callback' => bfa_comments, 
			'type' => 'comment'
			));

		echo "<BR><h3 id='comments'>Trackbacks:</h3>";
		echo "<div id='pings'>";

		wp_list_comments('type=pings&callback=list_pings');
		
		echo "</div>";

		//end add-in
	} else {
The id=comments for the trackbacks header makes it the same css formats as the comments title above it. The div id=pings is useful for customized css, as noted below.

In the functions.php, I put the following at the bottom of the existing functions.php:

Code:
<?php  

//add-in by derek beck for 
//from www.wphacks.com/separating-trackbacks-from-comments-in-wordpress-2-7/
		
function list_pings($comment, $args, $depth) {
$GLOBALS['comment'] = $comment;
?>
<li id="comment-<?php comment_ID(); ?>"><?php comment_author_link(); ?>
<?php } ?>
<?php
add_filter('get_comments_number', 'comment_count', 0);
function comment_count( $count ) {
if ( ! is_admin() ) {
global $id;
$comments_by_type = &separate_comments(get_comments('status=approve&post_id=' . $id));
return count($comments_by_type['comment']);
} else {
return $count;
}
}
//end add-in
?>
Finally, in the ATA settings, CSS Inserts, I added the following CSS, which I've commented out a few things, but you get the idea on how to change stuff:

Code:
div#pings li {
	position: relative;
	left: 10px;
	font-size: 0.8em !important;	
	font-weight: normal !important;
	margin-bottom: 4px !important;
}
div#pings li a:visited, div#pings li a:link {
	/*color: #663333;*/
	font-weight: normal !important;
}
div#pings li a:hover, div#pings li a:active {
	/*same as default links*/
	/*color: #CC0000;*/	
	font-weight: normal !important;
}
The result can be seen at http://www.derekbeck.com/1775/info/british-christmas/

hope that helps someone!
  #5  
Old Feb 7, 2012, 06:31 PM
tattvaanveShaNam
 
5 posts · Mar 2011
I created a Atahualpa child theme and copied over the comments.php and functions.php to the child theme directory with the intent to make these edits in those files. However, the presence of functions.php causes the site to not load. I don't wish to edit the theme files in the parent Atahualpa folder since an upgrade will ease those edits. I already have a edited index.php in the child theme folder and that works fine. Any suggestions on the functions.php?
  #6  
Old Feb 7, 2012, 07:18 PM
juggledad's Avatar
juggledad
 
22,326 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
You need to go back and read about child themes.
HTML Code:
Unlike style.css, the functions.php of a child theme does not override its counterpart from the parent. 
Instead, it is loaded in addition to the parent’s functions.php. (Specifically, it is loaded right 
before the parent’s file.)
taken from http://codex.wordpress.org/Child_Themes
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #7  
Old Feb 7, 2012, 07:48 PM
tattvaanveShaNam
 
5 posts · Mar 2011
@juddledad, thanks for pointing me in the right direction.
  #8  
Old Feb 8, 2012, 12:44 AM
tattvaanveShaNam
 
5 posts · Mar 2011
How do I make the "Pingbacks/Trackbacks:" text conditional? Using the nested conditional results in the comments+comment form and the sidebars to vanish. (pardon my lack of php skills)

Quote:
<?php // Do this for every comment
if ($bfa_ata['separate_trackbacks'] == "Yes") {

wp_list_comments(array(
'avatar_size'=>$bfa_ata['avatar_size'],
'reply_text'=>__(' &middot; Reply','atahualpa'),
'login_text'=>__('Log in to Reply','atahualpa'),
'callback' => 'bfa_comments',
'type' => 'comment'
));

if ( ! empty($comments_by_type['pings']) ) {
echo "<h3 id="pings">Pingbacks/Trackbacks:</h3>";
<ol class="pinglist">
<?php wp_list_comments('type=pings&callback=list_pings') ;
</ol>
}


} else {

wp_list_comments(array(
'avatar_size'=>$bfa_ata['avatar_size'],
'reply_text'=>__(' &middot; Reply','atahualpa'),
'login_text'=>__('Log in to Reply','atahualpa'),
'callback' => 'bfa_comments',
'type' => 'all'
));

} ?>
  #9  
Old Feb 8, 2012, 06:37 AM
juggledad's Avatar
juggledad
 
22,326 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
You have to pay attention to when you are in PHP and when handling HTML, try this
HTML Code:
<?php // Do this for every comment
if ($bfa_ata['separate_trackbacks'] == "Yes") {

	wp_list_comments(array(
	'avatar_size'=>$bfa_ata['avatar_size'],
	'reply_text'=>__(' &middot; Reply','atahualpa'),
	'login_text'=>__('Log in to Reply','atahualpa'),
	'callback' => 'bfa_comments', 
	'type' => 'comment'
	));

	if ( ! empty($comments_by_type['pings']) ) { ?>
		<h3 id="pings">Pingbacks/Trackbacks:</h3>
		<ol class="pinglist">
		<?php wp_list_comments('type=pings&callback=list_pings'); ?>
		</ol>
		<?php }	
	else {
		wp_list_comments(array(
		'avatar_size'=>$bfa_ata['avatar_size'],
		'reply_text'=>__(' &middot; Reply','atahualpa'),
		'login_text'=>__('Log in to Reply','atahualpa'),
		'callback' => 'bfa_comments', 
		'type' => 'all'
		));
	}
} ?>
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #10  
Old Feb 8, 2012, 10:48 PM
tattvaanveShaNam
 
5 posts · Mar 2011
@juddledad, Thanks. I had to slightly modify your modification, but here is the final version:


PHP Code:
<?php // Do this for every comment
    
if ($bfa_ata['separate_trackbacks'] == "Yes") {

        
wp_list_comments(array(
        
'avatar_size'=>$bfa_ata['avatar_size'],
        
'reply_text'=>__(' &middot; Reply','atahualpa'),
        
'login_text'=>__('Log in to Reply','atahualpa'),
        
'callback' => 'bfa_comments'
        
'type' => 'comment'
        
));

        
$comments_by_type = &separate_comments(get_comments('status=approve&post_id=' $id));
        if ( ! empty(
$comments_by_type['pings']) ) { ?>
            <h3 id='pings'>Pingbacks/Trackbacks:</h3>
            <div id='pings'>
            <ol class="pinglist">
                <?php wp_list_comments('type=pings&callback=list_pings'); ?>
            </ol>
            <?php }    
    }
    else {
        
wp_list_comments(array(
        
'avatar_size'=>$bfa_ata['avatar_size'],
        
'reply_text'=>__(' &middot; Reply','atahualpa'),
        
'login_text'=>__('Log in to Reply','atahualpa'),
        
'callback' => 'bfa_comments'
        
'type' => 'all'
        
));
    }
?>

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
creating 2 separate boxes in header, for logo and nextgen slideshow gallery rinoa3108 Header configuration & styling 8 Mar 8, 2010 06:19 PM
Making separate pages to display posts by category; also, how to embed WP page Eric Bobrow Atahualpa 3 Wordpress theme 1 Dec 2, 2009 01:34 AM
Changing displayed text and style of trackbacks and pingbacks Gravity Comments, trackbacks & pings 1 Sep 8, 2009 10:47 AM
Trackback auto-discovery is not sending trackbacks ditto Comments, trackbacks & pings 1 Jul 11, 2009 06:07 AM
Post/Page Info Items - Trackbacks Andrea Post-Kicker, -Byline & -Footer 2 Feb 27, 2009 06:13 AM


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


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