PHP Function for External Project URL?

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

Viewing 2 posts – 1 through 2 (of 2 total)
  • Anonymous
    #128255

    Hey!

    I’m in the process of customizing the results of my Search & Filter results from within public_html/wp-content/themes/salient/search-filter/results.php. I see a number of PHP variables for various portfolio attributes, such as the_title() for the title and the_excerpt() for the excerpt. But I can’t seem to find the PHP variable for the External Project URL. I’ve made a few attempts (the_external_project_url(), the_external_url(), etc.) but haven’t gotten anything to work.

    What is the PHP variable for the External Project URL attribute of a Portfolio item?

    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 2 posts – 1 through 2 (of 2 total)

Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.