WordPress.org

Ready to get started?Download WordPress

Forums

WP Customer Reviews
Character snippet (9 posts)

  1. pimlfo
    Member
    Posted 1 year ago #

    i used a shortcode for display a reviews on my page with snippet but it did not display correct.
    [WPCR_SHOW POSTID="ALL" NUM="9" SNIPPET="150" MORE="read more" ]

    You can have a look at http://www.vietvaluetravel.com/feedback/
    i want to display the first 150 characters( i tried with other number of snippet but it's the same )

    Appreciate for your advice.

    http://wordpress.org/extend/plugins/wp-customer-reviews/

  2. essaysnark
    Member
    Posted 1 year ago #

    Hey pimlfo - the developer seems not to be coming around here much right now so I'll see if I can help (my knowledge is limited though). Did you try putting the shortcode in a widget on the sidebar to see if it would render, just as an example of something else to test? I'm able to use it that way with no problems. Do any of the other parameters work in the shortcode on the current page? Does it matter if you just use SNIPPET="" ?

  3. pimlfo
    Member
    Posted 1 year ago #

    Actually, i used the shortcode on my page and want to display the first 200 character.
    i found that, if i break down the line, it will not display the second line. For example:
    "hi essaysnark,
    please help me to solve this problem"
    then it display " hi essaysnark" only ( even you set a snippet="400" or more )
    if i write the review on the same line then it works great.
    How to fix it?

  4. essaysnark
    Member
    Posted 1 year ago #

    I can't guarantee that this won't break something else but I have a fix for you. You'll need to modify the core plugin file - and since an update just came out you should upgrade first, since the upgrade will overwrite this change (remember that for future upgrades too, you may have to re-do this change later).

    Open the file wp-customer-reviews.php (in the directory /wp-content/plugins/wp-customer-reviews).

    Change this (line 853):
    preg_match("/^(.{1,$len})[\s]/i", $text, $matches);

    to this:
    preg_match("/^(.{1,$len})[\s]/s", $text, $matches);

    Make a backup of your plugin before you do this in case something gets screwed up.

  5. pimlfo
    Member
    Posted 1 year ago #

    hi Essay,

    Appreciate for your help.
    It works perfectly.
    thank you once again.
    :D

  6. essaysnark
    Member
    Posted 1 year ago #

    No they're not the same. You need to change line 853 to the new one I posted. It is different (/s instead of /i).

  7. pimlfo
    Member
    Posted 1 year ago #

    Dear Essay,

    there's a problem with " it's "
    it display " it/'s " as output.

  8. essaysnark
    Member
    Posted 1 year ago #

    pimlfo, unfortunately you discovered a bug. That error has nothing to do with the change we suggested; the same thing happens with the original unmodified code. It's a problem with how the plugin handles edits. It's saving the standard apostrophe character to the database as \'

    I don't have time to help you debug and fix this one right now. A workaround that you can use is to go back to any of the saved reviews which you edited in the Customer Reviews screen and change the ' character to the ` (backtick) character instead.

  9. TonyDehnke
    Member
    Posted 1 year ago #

    Thanks, the shortcode edit for sidebar display worked for me to! I used this on the version just released.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags