Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author xnau webdesign

    (@xnau)

    You need to add the plugin’s file location URL to the field value (which is simply the filename) to get your absolute URI for the image…like this:

    <?php
    echo Participants_Db::files_uri() . $record->get_value('photo');
    ?>
    Thread Starter DownRightGamer

    (@rcarmichael)

    Sorry, that was a typo of mine above. I said I got the image value using:
    Participants_Db::files_uri() . $record->print_value('photo')

    When i’ve actually been using:
    echo Participants_Db::files_uri() . $record->get_value('photo');

    Which, as stated above, gives me a bad image URL:
    <meta property="og:image" content="https://tamuphysastr.wpengine.com/wp-content/uploads/directory/ryan_carmichael_science_4x4">

    Sorry for the confusion. Do you have a resolution? Thank you.

    Plugin Author xnau webdesign

    (@xnau)

    Are you using the image expansion kit add-on? That changes things a lot.

    Thread Starter DownRightGamer

    (@rcarmichael)

    Yes, I am. 🙂 Love it by the way.

    Plugin Author xnau webdesign

    (@xnau)

    Right, so that will change how you need to the the URI because the image file is actually in the media library.

    There is a helper function in the image expansion kit you can use for that:

    <?php
    $uri = get_attachment_url_by_slug( $record->get_value('photo') );
    <?
    Thread Starter DownRightGamer

    (@rcarmichael)

    Roland, you’re awesome! 😀 That worked perfectly!!!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Social Metadata Image Issue’ is closed to new replies.