Strict Standards: Redefining already defined constructor for class bbdb in /home/themes/public_html/forums/bb-includes/db-mysql.php on line 12

Strict Standards: Declaration of BB_Walker_Blank::start_lvl() should be compatible with BB_Walker::start_lvl($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Strict Standards: Declaration of BB_Walker_Blank::end_lvl() should be compatible with BB_Walker::end_lvl($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Strict Standards: Declaration of BB_Walker_Blank::start_el() should be compatible with BB_Walker::start_el($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Strict Standards: Declaration of BB_Walker_Blank::end_el() should be compatible with BB_Walker::end_el($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127
Add comment_count to my_multiplecomments_text « ThemeShaper Forums

ThemeShaper Forums » Thematic

[closed]

Add comment_count to my_multiplecomments_text

(7 posts)
  • Started 3 years ago by 1visible
  • Latest reply from middlesister
  • This topic is not resolved
  1. 1visible
    Member

    Hi again,
    please, how to add $comment_count > 1 ? __ (…) to this? :

    function my_multiplecomments_text($text) {

    return 'personnes vous offrent leur témoignage';

    }
    add_filter('thematic_multiplecomments_text', 'my_multiplecomments_text');

    This function make the comment_count to disappear :(

    Sorry, I'm not a php crack (this means all my trys are falling down, bouh!).

    Posted 3 years ago #

  2. Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 440

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 510

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 512


    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 440

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 510

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 512
    em hr

    Moderator

    That filter feeds into printf() and you are missing the integer specifier: d

    Try:

    return '%d personnes vous offrent leur témoignage';

    Posted 3 years ago #
  3. 1visible
    Member

    "The simplest is the most difficult… unless you have the key…"
    Ok dear, you did it!
    Thank you :)

    Posted 3 years ago #
  4. 1visible
    Member

    Sorry but I just realize:
    Is there any way to print this return on sidebar ?
    I use PHPcode widget, the result is "0 (nobody) personnes vous offrent leur témoignage"

    Posted 3 years ago #

  5. Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 440

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 510

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 512


    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 440

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 510

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 512
    em hr

    Moderator

    This line from Thematic's comments.php give an example of using the global variable $thematic_comment_count to account for text strings for singular or multiple comments.

    <h3><?php printf( $thematic_comment_count > 1 ? __( thematic_multiplecomments_text(), 'thematic' ) : __( thematic_singlecomment_text(), 'thematic' ), $thematic_comment_count ) ?></h3

    Posted 3 years ago #
  6. 1visible
    Member

    Yes, that's what I have done. But the result is always "zero comments…" instead of for exemple "28 comments…".

    The fact is I have only one page with opened comments, it's a testimonial page.
    The query here is: how to display in the sidebar on the entire site, the number of those testimonials from this particulary page ?

    I can edit a simple html line by hand to do that, of course.
    But I was hoped than the Thematic power could do this by itself.

    With my noob words I'll tell something like:
    "It's missing the "page ID filter" to tell how many comments there are on this page."

    Posted 3 years ago #
  7. middlesister
    Member

    If you want to display the number of comments in the sidebar, you cannot use $thematic_comment_count because it will refer to the number of comments belonging to the current post. Plus, I think it only works inside the comment loop

    Try using the good old get_comments_number( $ID ), and give the testimonial postID as parameter.

    Posted 3 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.


Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method GA_Filter::spool_analytics() should not be called statically in /home/themes/public_html/forums/bb-includes/wp-functions.php on line 586

Strict Standards: Non-static method GA_Filter::spool_this() should not be called statically in /home/themes/public_html/forums/my-plugins/googleanalytics.php on line 183