• Resolved jewelsmac6

    (@jewelsmac6)


    I have downloaded and am now using your Petfinder plugin for a site I am in the process of building. Great plugin, thank you!

    First question is…
    I need to remove the pet’s story from the running list after inserting the short code [shelter_list]. How can I do that, without using the Featured Pet widget so that more than just one pet displays?

    In other words, I would like to display my [shelter_list] without the pet’s description, so that it shows a more compact summary for easy browsing on my home page – only showing the pet’s name, the main pic, and the “include_info”.

    Second question is…
    Because I am finding that the pet’s description is taking too much vertical space, is it possible for the user to click on the pet’s name and the pet’s pic, to then bring the user to the pet’s profile page on petfinder.com? Right now, when I hover or click on the pet’s name, an underline shows up (indicating that the pet’s name is a hyperlink), but after clicking the pet’s name, it doesn’t go anywhere; its a dead link. Having the pet’s name and photo link to their profile page on petfinder.com would be perfect!

    Thanks again for the great plugin!!

    https://www.ads-software.com/extend/plugins/petfinder-listings/

Viewing 15 replies - 1 through 15 (of 26 total)
  • Just chiming in, I would love this functionality too!

    First Question:
    If I understand correctly, you would be able to use display:none to hide the descriptions. You can use the WordPress function to check for front page, and load a certain CSS if it is. This is one of the MANY ways to do it. Currently, the description is part of the ‘description’ class, which may be used in other parts of the site. You do not want to hide it globally.

    Second Question:
    Currently, the pet-finder API does not return a direct link to the pet’s page on Petfinder as seen below:
    https://www.petfinder.com/developers/api-docs

    HOWEVER, they do return the unique Pet ID

    <pet>
      <id>24322302</id>
      ...
    </pet>

    You can modify the PHP file to append this ID on the following URL:
    https://www.petfinder.com/petdetail/

    So that a pet with 24322302 as the ID will link to :
    https://www.petfinder.com/petdetail/24322302

    I have not used this plugin for quite a while, so maybe there was an update that included what you wanted. Anyways, if you need more assistance, please reply to this thread. Good luck!

    Thread Starter jewelsmac6

    (@jewelsmac6)

    Thank you very much, rawrzors! I will try this later tonight when I get home from work, and let you know how it goes.

    I also wanted to ask, would you have any insight to the other question I posted in this forum:
    https://www.ads-software.com/support/topic/list-new-additions-first

    Any other help is appreciated! Thanks again!

    Where in the petfinder-listings.php file would you add the url?

    Hi Burn,

    I believe it is in line 225
    $output_buffer .= "<div class=\"dog\"><div class=\"name\"><a name=\"" . $dog->id . "\">". $dog->name . "</a></div>";

    Replace it with
    $output_buffer .= "<div class=\"dog\"><div class=\"name\"><a href=\"https://www.petfinder.com/petdetail/".$dog->id."\ name=\"" . $dog->id . "\">". $dog->name . "</a></div>";

    Thread Starter jewelsmac6

    (@jewelsmac6)

    I also just added in this new code at line 225, but did not see any change on my homepage: heartsherd.com. The pet’s name is not clicking through to their Petfinder ID page and the full description is still there. Any ideas? Thank you!

    I have not had the chance to test it. Must have been mistaken.
    Revert line 255.

    Line 355 seems that it may work. Replace the <a> tag there with

    <a href=\"https://www.petfinder.com/petdetail/".$dog->id."\ name=\"" . $dog->id . "\">". $dog->name . "</a>

    Thread Starter jewelsmac6

    (@jewelsmac6)

    That’s ok! I was just looking at that line too, after I did a search for “output” to find all the instances. I replaced the tag at line 355, and still no change.

    Jewels,

    It should be working. I believe you are using the widget, which would require you to modify the featuredpet-widget.php.

    I believe line 44 is the place you are looking for. If not, search around the php file, the concept remains the same.

    Good luck

    Thread Starter jewelsmac6

    (@jewelsmac6)

    This is the shortcode below on the home “page” that I am using:

    [shelter_list css_class=”clear”]

    I also changed the tag on line 44 of the “featuredpet-widget.php” but still no change. ??

    Sorry about the issues, just got home and was able to get a test site up.

    Line 225 was correct. Small typo (missing quote) in my initial message though.

    This should be correct, just tested it.

    $output_buffer .= "<div class=\"dog\"><div class=\"name\"><a href=\"https://www.petfinder.com/petdetail/".$dog->id."\" name=\"" . $dog->id . "\">". $dog->name . "</a></div>";

    Thread Starter jewelsmac6

    (@jewelsmac6)

    Somehow, I got the code to half-work… The pet’s name is now clickable, but the link is incorrect. I also took this offline to my own wordpress site, so as to not mess anything up on the live NPO website: https://jewelsdesignworks.com/petfinder/

    I inserted the following new code into lines 541 and 807 on “petfinder-listings.php” (before the case "noCats": section of code):

    case "moreInfo":
    $icons .= "<a href=\"https://www.petfinder.com/petdetail/".$dog->id."\>". $dog->name . "</a>"; break;

    And this is the resulting click-through link when you click on Dublin’s name:
    https://www.petfinder.com/petdetail/22922725\ name=

    Does this make any more sense from what you suggested? Thank you!!

    The \ name= comes from a missing quote. Make sure it looks like $dog->id."\" I addressed this in my previous post.

    My petfinder-listings.php (most recent version) only goes up to line 460. I had assumed we were using the same version, sorry.

    Thread Starter jewelsmac6

    (@jewelsmac6)

    That’s ok. That might explain where the difference in codes are coming up. I just installed the plugin to my website, and this is the complete code

    [800+ lines of code removed – please use a pastebin]

    @jewelsmac6 – that’s really way too much code to post on these forums (over 800 lines) – could you repost that to a pastebin per:

    https://codex.www.ads-software.com/Forum_Welcome#Posting_Code

Viewing 15 replies - 1 through 15 (of 26 total)
  • The topic ‘Remove pet description and link to petfinder’ is closed to new replies.