Support » Fixing WordPress » Linking a featured image to a different WP page

  • Resolved aramaz

    (@aramaz)


    Hi

    On my front page there are a couple of featured images listed from a couple of posts. How do I link those featured images to a different page and not an attachment page? I’d like to use the URL from the “Link URL” field in the “Edit Image” window. How do ir each that field and what do I have to enter into the template?

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Doh, that was simple. I ended up using the custom fields underneath the post:

    1. first I named the custom fields “featured”
    2. then I entered the url I wanted into the “Value” box
    3. I then used the get_post_meta function to reach the URL and insert it into the theme (check example in the codex page for similar code).

    If you don’t see the custom fields section underneath the post, clickon Screen Options on the top of the page and turn them on there.

    Is there a way you can give an example of your code? I used the same name featured as you did. my post id would be 444 I guess which i got from the url above. and not sure to put true or false.

    here is my code i think and i’m not sure where I should put this. header, index ?
    <?php $meta_values = get_post_meta($444, $featured, $true); ?>
    Thanks,
    B

    Yeah, I would really like to see an example or more detail of what aramaz did. This is something I have been looking to do.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Linking a featured image to a different WP page’ is closed to new replies.