|
#1
Apr 20, 2013, 05:26 AM
|
|
Good morning and congratulations for the great theme.
In wp-includes (comment-templates.php) I changed the original function comments_number in order to have a fifth option ($ zero = false, $ one = false, $ less = false, $ more = false, $ deprecated = '').
The code works fine on the pages of posts.
What I ask is: how do I implement the same function to have the vision of the counts even in the setting of the byline?.
I use Ata 3.7.10 and wp 3.5.1
Thanks
|
#2
Apr 20, 2013, 05:44 AM
|
|
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
you'll probably have to edit bfa_postinfo.php but first I'd suggest you upgrade to 3.7.12
|
#3
Apr 20, 2013, 06:22 AM
|
|
Thanks kind Mr. Juggledad.
Honestly though, I can not proceed. Can you be so kind as to tell me exactly where and what to change?.
Thanks
|
#4
Apr 20, 2013, 07:29 AM
|
|
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
not really, not without knowing what you did to comment-templates.php and then spending a lot of time looking at the interaction.
This is not a theme issue and beyond what I'm willing to do for free because of how much of my time would be involved.
If you aren't capable of doing this, I suggest you advertise and see if you can hire someone to do it or rethink the need for this.
|
#5
Apr 20, 2013, 07:59 AM
|
|
What you wrote is correct and I can not pretend, of course.
I hope that seeing the changes that I have made, you can guess if the problem is solved or not.
Thanks anyway gentle Mr. Juggledad.
Code:
function comments_number( $zero = false, $one = false, $less = false, $more = false, $deprecated = '' ) {
if ( !empty( $deprecated ) )
_deprecated_argument( __FUNCTION__, '1.3' );
$number = get_comments_number();
if ( $number > 1 && $number <12 )
$output = str_replace('§', number_format_i18n($number), ( false === $less ) ? __('§ Comments') : $less);
elseif ( $number >= 12 )
$output = str_replace('%', number_format_i18n($number), ( false === $more ) ? __('% Comments') : $more);
elseif ( $number == 0 )
$output = ( false === $zero ) ? __('No Comments') : $zero;
else // must be one
$output = ( false === $one ) ? __('1 Comment') : $one;
echo apply_filters('comments_number', $output, $number);
...and others little pieces of code.
Two of the results are these:
Last edited by giacinto; Apr 20, 2013 at 08:55 AM.
|
#6
Apr 22, 2013, 06:49 AM
|
|
Good afternoon Mr. Juggledad,
really you can't help me, just only addressing me on the right way?.
I'm sure that the others guys like the adding option.
Please!.
Best regards
|
#7
Apr 22, 2013, 07:37 AM
|
|
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
You are looking for a custom modification to the theme. This is beyond the scope of this forum.
I suggest you hire someone to do it for you.
|
#8
Apr 23, 2013, 03:11 AM
|
|
Right!.
Thank you Mr. Juggledad!.
|
#9
Apr 26, 2013, 04:33 AM
|
|
Good morning, kind Mr. Juggledad.
It was not really that hard. All it took was fiddling about thirty minutes and at the end I got what I wanted, without losing, in fact, long time.
I think that a capable person like you, would solve the problem in two minutes and would not have engaged for hours, as you had written.
Sometimes it would be advisable not stick exclusively for the purposes of the forum, because we are all "in the same boat."
Have a wonderful day!.
|
#10
Apr 26, 2013, 04:48 AM
|
|
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
so why don't you share your solution for others?
|
#11
Apr 26, 2013, 06:17 AM
|
|
Hello gentle Mr. Juggledad.
I didn't it, because you wrote that the question that I have submitted, is not part of the interest of this blog!.
|
#12
Apr 26, 2013, 06:33 AM
|
|
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
I said it wasn't a theme issue and I wasn't willing to dig into it.
Bbut since you have figured it out, why not share your solution with others on the forum. Write up a detailed explaination of what you did...after all isn't that what you wanted me to do?
|
#13
Apr 26, 2013, 08:13 AM
|
|
All right!.
My little need came from the desire to highlight the items with a substantial number of comments.
As I described before, the function should give me back not 4 but 5 conditions: 0, 1, >1 and <?, >?.
First I find the function 'comments_number' in wp-includes/comment-template.php, and I laid down the conditions as in the following pieces of code.
Code:
function comments_number( $zero = false, $one = false, $less = false, $more = false, $deprecated = '' ) {
if ( !empty( $deprecated ) )
_deprecated_argument( __FUNCTION__, '1.3' );
$number = get_comments_number();
if ( $number > 1 && $number <12 )
$output = str_replace('§', number_format_i18n($number), ( false === $less ) ? __('§ Comments') : $less);
elseif ( $number >= 12 )
$output = str_replace('%', number_format_i18n($number), ( false === $more ) ? __('% Comments') : $more);
elseif ( $number == 0 )
$output = ( false === $zero ) ? __('No Comments') : $zero;
else // must be one
$output = ( false === $one ) ? __('1 Comment') : $one;
echo apply_filters('comments_number', $output, $number);
}
...after
Code:
function comments_popup_link( $zero = false, $one = false, $less = false, $more = false, $css_class = '', $none = false ) {
global $wpcommentspopupfile, $wpcommentsjavascript;
$id = get_the_ID();
if ( false === $zero ) $zero = __( 'No Comments' );
if ( false === $one ) $one = __( '1 Comment' );
if ( false === $less ) $less = __( '§ Comments' );
if ( false === $more ) $more = __( '% Comments' );
if ( false === $none ) $none = __( 'Comments Off' );
....
...after
Code:
....
echo ' title="' . esc_attr( sprintf( __('Comment on %s'), $title ) ) . '">';
comments_number( $zero, $one, $less, $more, $none );
echo '</a>';
....
After that I changet too the bfa_postinfo.php in the folder functions in Atahualpa Theme at the position of the below code:
Code:
....
$comment_options = preg_match("/(.*)%comments\('(.*?)'(.*?)'(.*?)'(.*?)'(.*?)'(.*?)'(.*?)'(.*)/i",
$postinfo_string,$comment_matches);
if ( !comments_open() AND $comment_matches[10] == "dontshow" ) {
$comment_link = '';
} else {
ob_start();
comments_popup_link($comment_matches[2], $comment_matches[4],
$comment_matches[6], $comment_matches[8], 'comments-link', $comment_matches[10]);
$comment_link = ob_get_contents();
ob_end_clean();
}
if (!comments_open() ) {
if ($post->comment_count == 0) {
$comment_link = '<strong>' . $comment_matches[10] . '</strong>';
} else {
$comment_link = $comment_link . ' - <strong>(' . $comment_matches[10] . ')</strong>';
}
}
if ( !comments_open() AND $comment_matches[10] == "dontshow" ) {
$comment_link = '';
}
....
On BYLINE of Homepage and Multi Post Pages I put the following code:
Code:
....
%comments(' <image(comment.gif)> 0 ', ' <image(comment.gif)> 1 ', ' <image(comments.gif)> § ', ' <image(comments.gif)> % and some other thing, just for to point out the post ', ' ')%
....
That's all!.
-------------------
I made also some variations in the comment.php, but for to show what I posted already and you can see on the above pictures.
|
#14
Apr 26, 2013, 08:16 AM
|
|
Hello gentle Mr. Juggledad,
What do you think of this?.
Friendliness
|
#15
Apr 26, 2013, 08:19 AM
|
|
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
Good job! hopefully someone else may find this helpful.
btw don't forget that the next time you update WordPress or the theme you will have to redo part or all of this.
|
#16
Apr 26, 2013, 08:25 AM
|
|
Hello gentle Mr. Juggledad,
Thank you... I keep in my mind your suggestions!.
A next.
Bye
|
Similar Threads
|
Thread |
Thread Starter |
Forum |
Replies |
Last Post |
Greg's Comment Numbering Plugin and Styling
|
Nolie |
Comments, trackbacks & pings |
9 |
Sep 28, 2017 04:42 AM |
[SOLVED] "Quick and Dirty Comment Numbering" Not working for latest update of the the
|
Shan_LSOS |
Comments, trackbacks & pings |
5 |
Oct 26, 2010 01:03 AM |
[SOLVED] Quick/Dirty Comment Numbering
|
rickheck |
Comments, trackbacks & pings |
8 |
Aug 25, 2010 11:20 AM |
[SOLVED] Numbering comments using Greg's Threaded Comment Plugin
|
perdox808 |
Comments, trackbacks & pings |
7 |
Dec 6, 2009 11:16 AM |
Please help... Comment numbering
|
jmarsden92 |
Comments, trackbacks & pings |
1 |
Jul 28, 2009 05:23 AM |
|