Forums Forums Search & Filter Pro PHP Function for External Project URL?

Viewing 1 post (of 1 total)
  • Trevor
    #128266

    As I have not seen this requested before, can I assume that you have portfolio items, maybe as a Custom Post Type, and one field (probably a custom field) is the ‘external project URL’?

    If that is so, it is probably a meta key. You can test this in your search form by adding a Post Meta object to the form, make it a dropdown select, find the meta key name from the list, make the choices a manual selection, not automatic (which is the default), and there is then a search button/function to find the values already stored. If they look right, then you have found the key name.

    Then you need to use the standard WordPress codex method to call in a value for a custom field, like this:

    <?php echo get_post_meta( get_the_ID(), 'external_project_url', true ); ?>
    

    Depending on the actual key name. Note that fields made with specific plugins sometimes have different functions to retrieve the data, as does ACF for instance (using get_field()).

Viewing 1 post (of 1 total)