Search
 

Is that possible to link FCG Image to my preferred URL?

Ok, so what if you dont want to make all the “feature” posts to have a ‘special’ URL? What if you only want certain posts to have a ‘special’ URL? (or if you forget to specify a custom link)

Well you replace this code in \plugins\featured-content-gallery\gallery.php:

Code:
<a href="<?php the_permalink() ?>" title="Read More"></a>

With…

Code:
<a href="<?php
$link = get_post_meta($post->ID, "link", $single = true);
if ( $link ) { echo $link; }
else { the_permalink(); } ?>" title="Read More"></a>

To specify the link (URL) – add the custom field link with the full URL to the website.

Please note: You will need to do this in two places. The first is located at line 44 and the second one is around line 69.

What the code asks is:

Get Link > If link is found, post link > If NOT found, post link to post.

Comments are closed.

Testimonials

“I’ve received A LOT of great feedback from my colleagues about the site. So thank you.”
Peter, www.saintpetersblog.com

Online Payment Portal

Use this portal to make a payment toward your services via PayPal.