WordPress.org

Forums

Petfinder Listings
[resolved] Char Set Issue (11 posts)

  1. greginky
    Member
    Posted 1 year ago #

    On my Adoptable Animals page, the one that is linked to the PetFinder Listings plugin, I am having a character formatting issue.

    EXAMPLES:
    Murphy’s
    Gracie’s

    http://www.bgsdr.com/adoptable-dogs/

    I assume it is a char set issue but don't have a clue as how to fix it

    https://wordpress.org/plugins/petfinder-listings/

  2. rawrzors
    Member
    Posted 1 year ago #

    Hi,

    Try:
    $dog->description = str_replace("â", "'", $dog->description);

    on line 353 right after

    switch ($dog->size){
    case "L":
    $size = "Large";
    break;
    case "M":
    $size = "Medium";
    break;
    case "S":
    $size = "Small";
    break;
    default:
    $size = "Not known";
    break;
    }
  3. greginky
    Member
    Posted 1 year ago #

    2 questions:
    #1 header.php file?
    #2 How can I get the line numbers to show?

  4. rawrzors
    Member
    Posted 1 year ago #

    #1:
    petfinder-listings.php

    #2:
    Depends on what editor you are using. I can't really answer that question. Look for the pattern I referenced, it should be near the bottom.

  5. greginky
    Member
    Posted 1 year ago #

    That did not do it unfortunately. I found the right place to put it. I am only using notepad as an editor

  6. greginky
    Member
    Posted 1 year ago #

    Well since I can't find the answer to this then I will just have to do the next best thing, change my PetFinder listing and remove all instances of the apostrophe.I think I have read on one of these forums or threads that PetFinder strips the html from their listings. I don't know if maybe this can be fixed by looking into the PetFinder side of things. I really don't want to have to change the wording but it is better than having the char set problem.

  7. rawrzors
    Member
    Posted 1 year ago #

    Sorry, I have been really busy with work.

    Please hold off on doing that, it seems like a lot of unnecessary work. I may have a solution in a few mins.

  8. rawrzors
    Member
    Posted 1 year ago #

    Put the following at the end of the <script> tags of the code I gave you earlier for the widget trim (header.php). Make sure you do not accidentally place it within the other document.ready, or you will probably break both scripts.

    $(document).ready(function () {
        var desc = $('.description').contents()
    
        for (var i = 0; i < desc.length; i++) {
    
            desc[i].textContent = desc[i].textContent.replace(/â/g, '\'');
    
        }
    });
  9. greginky
    Member
    Posted 1 year ago #

    Hey, no need to apologize. I am extremely grateful for all that you have done for me. Unfortunately I put this in and it still doesn't work. I went back and double checked to make sure that I followed your instructions to the letter, but still no dice. I am assuming that by the end of the scripts as after the </script> tag.

  10. rawrzors
    Member
    Posted 1 year ago #

    Hi, it seems that you did not put my code within the <script> section.

    Currently it is...
    <script src...></script>
    NEW CODE
    <script></script>

    It should be
    <script>NEW CODE</script>

    Make sure that the new code is contained within a <script> tag, preferably not the <script src> one.

  11. greginky
    Member
    Posted 1 year ago #

    Great, thank you so much. wrapping the code in in the script tags did the trick.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Petfinder Listings
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.