• Sorry for the newby question, but I would have though that a
    permalink like

    https://localhost/~galagun/rescue/?page_id=43&pet_id=35020702

    and shortcode like

    [get_pet pet_id=$pet_id include_info="no" css_class="igs"]

    would do the trick, but I get is the error message “Invalid Pet ID supplied.”. I know that the pet_id points to one of our own dogs on petfinder.com.

    Thanks in advance for your help.

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author bridgetwes

    (@bridgetwes)

    Yes, that should display a pet. Did you replace $pet_id in the shortcode with the ID of the pet, 35020702?

    It would look like this:

    [get_pet pet_id="35020702" include_info="yes" css_class="igs"]

    That shortcode displays Otis on my test site.

    Bridget

    Thread Starter galagun

    (@galagun)

    Sorry, I guess I wasn’t clear about what I’m trying to do. On one page, I would like to have a table of all of our available dogs, and when you click on the name or the picture, it should open the details page in a new tab. So pet_id would be a parameter of the hyperlink, and it’s value would be passed into the shortcode.

    Is there a way to do this, without putting an explicit numerical pet_id in the shortcode?

    Plugin Author bridgetwes

    (@bridgetwes)

    Hi,

    There isn’t a way to do this built into the plugin. You could try doing something like this in the template file (not in the WYSIWYG editor where the shortcode was – you might need to create a new template file if you don’t already have one for the single pet page).

    <?php $pet_id= $_GET["pet_id"];
    echo do_shortcode('[get_pet pet_id="' . $pet_id . '" include_info="yes" css_class="igs"]'); ?>
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to include pet_id in shortcode’ is closed to new replies.