Forums › Forums › Search & Filter Pro › Custom Search Result
- This topic has 5 replies, 2 voices, and was last updated 9 years, 4 months ago by
Trevor.
-
Anonymous(Private) November 22, 2016 at 8:52 am #71555
I am now doing custom result by search & filter pro. I already know the code <?php echo get_post_meta(get_the_ID(), ‘wpcf-price’, true); ?> to show custom post field. However I need to know the code to show
1. Custom taxonomy (e.g. slug = college)
2. An Image upload the post (e.g. slug = wpcf-image)Thanks
Trevor(Private) November 22, 2016 at 11:16 am #71594Taxonomy terms for a post can be retried like this, I think:
<?php $terms = wp_get_post_terms( get_the_ID(), $taxonomy, $args ); ?>See here:
https://codex.wordpress.org/Function_Reference/wp_get_post_terms
Images are attachments. I am assuming that you are not meaning the thumbnail, maybe you need this:
https://codex.wordpress.org/Function_Reference/get_attached_media
But that will give you an array, which you would then need to loop through.
Anonymous(Private) November 22, 2016 at 3:48 pm #71657Sorry Trevor I am quite beginner on coding. I not really understand wordpress codex documentary therefore i need help.
1. I have create custom taxonomy slug = college. I would like to show the selected name to show in result page.
2. I have create a custom field to upload images slug = image-gallery. I would like to show the image into the result page.Please assist.
Thanks
-
AuthorPosts