WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Linking a featured image to a different WP page (4 posts)

  1. aramaz
    Member
    Posted 2 years ago #

    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!

  2. aramaz
    Member
    Posted 2 years ago #

    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.

  3. SuperWebman1
    Member
    Posted 2 years ago #

    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

  4. rtibbs4
    Member
    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic