• I am trying to set up Gridsby as a simple one-page portal with image-buttons that link to other websites from the home page. To do that, I must make the images into Featured Images on their posts.

    Problem is, you can’t modify the URL value for a Featured Image, so instead of linking to another website, all the image-button does is open the image file.

    There’s a well defined work-around involving a custom field and a very limited bit of code, but I can’t find the equivalent spot in any of the Gridsby template code.

    Assuming this can’t be fixed directly (and none of the “redirect” plugins I’ve tried have any effect), how can I find and modify this bit of code in the Gridsby theme? Or (better) find a useful plugin for the purpose (I can’t believe this is an old outstanding problem in WP…)

    You can see the problem here. Original low-tech site and draft new site

    under development.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Theme Author modernthemesnet

    (@modernthemesnet)

    Hi Karen,

    The theme was designed to show off photos within an animated light box effect. You are right, it would take a bit of coding and a custom field to include a URL to link to.

    You will need to modify the template file “page-home.php” and edit the main query. You can surround the entire “figure” element with your custom field link and that should do the trick.

    Also, make sure to do this with a child theme so you don’t lose your changes with a future update.

    Best of luck!

    Thread Starter KarenMyers

    (@karenmyers)

    Thanks. I get the point, but I have no PHP background (old FORTRAN jock).

    I would be glad to pay for real support from modernthemes, but there’s no way to contact you without paying first (a website with no contact info — terrific), and I’m reluctant to just pay and hope. If this is something you can address as part of paid support, please let me know and I’ll swap over to there.

    Otherwise I need to ask a dumb question:

    I’ve set up a Child theme and made the following mods to page-home.php. It passes a PHP syntax check but I imagine I’m missing a “close” statement of some kind, and obviously my use of Echo is bad:

    <?php if ( has_post_format( ‘image’ )) { ?>
    [START MOD] $custom_featured_image_link = get_post_meta( get_the_ID(), ‘featured_image_link’, true);
    if ($custom_featured_image_link) echo $custom_featured_image_link;
    else
    [END MOD]
    <figure class=”gallery-image”>
    <?php the_post_thumbnail(‘gridsby-gallery-thumb’); ?>
    </figure><!– gallery-image –>
    <?php } ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Featured image URL preventing use as a portal’ is closed to new replies.