I've created an image field and I've set its post type to 'pages'. What I am trying to do is have a clickable image (uploaded in the custom image field) link to that respective page. Is that possible?
Hi vytenisK,
It is possible, I assume you have installed Views,
https://toolset.com/home/views-create-elegant-displays-for-your-content/
and your custom image field is slug "my-upload-image"
you can create such a image link like this:
<a href="[wpv-post-url]"><img src="[types field="my-upload-image" size="thumbnail" url="true"]" /></a>
https://toolset.com/documentation/functions/#Image
Parameters: ‘url’ => ‘true’|'false’ – When true it will output the url of the image instead of the img tag. Works with the size parameter to output the url of the re-sized image
[wpv-post-url] is a shortcode of Views:
https://toolset.com/documentation/views-shortcodes/#wpv-post-url
Thanks, I'm trying to do it through vanilla WP, but I'll keep this in mind.
If you do not have a copy of Views, you need do it with PHP code, for example:
Display the url to the current post:
<?php $permalink = get_permalink( $id ); ?>
http://codex.wordpress.org/Function_Reference/get_permalink