Setting external URL on featured Project images


#1

Hi there,

I am trying to force featured images on Project pages to direct to an external URL (not an image URL) when clicked.

Is this supported in the theme? How would I go about setting the URLs for each image please?

Kind regards,


#2

Hello there,

It isn’t supported by the theme. You might be able to accomplish with additional plugin like this one: https://wordpress.org/plugins/page-links-to/

Regards,
Kharis


#3

Thanks, unfortunately, the plugin didn’t work for my purposes.

I found this code, and have added the Custom Field “ExternalURL” to the page, but I’m not sure where I’d edit in the code for the theme:

<?php $name = get_post_meta($post->ID, 'ExternalUrl', true);

if( $name ) { ?>
<?php the_post_thumbnail('astrid-large-thumb'); ?>

<?php } else { the_post_thumbnail('astrid-large-thumb'); } ?>

The original post suggests the page.php file, but I believe it might be template-parts/content-page.php

Link to original post

Can you assist at all please?

Kind regards,