WordPress.org

Ready to get started?Download WordPress

Forums

Kontrol Developer Kit
[resolved] Get /Display Post image (3 posts)

  1. lizzydevine
    Member
    Posted 1 year ago #

    Hi,

    I've created a custom field where you can choose a post.
    I need to display the Posts thumbnail (first image), the title and
    make this whole thing a link to the post.

    Can't really figure out the code for this.
    My custom field is called "headline1"

    Thanks so much
    Jimmy

    http://wordpress.org/extend/plugins/kontrol-developer-kit/

  2. lizzydevine
    Member
    Posted 1 year ago #

    never mind.. I figured it out:
    this is my code:

    <?php $plink = get_setting('headline2');?>
     <?php $postid = url_to_postid($plink);?>
    
    <?php echo get_the_post_thumbnail($postid);?>
    <h2>
    <a href="<?php  echo get_setting('headline2');?>"> <?php echo get_the_title($postid); ?>  </a>
    </h2>
  3. Kontrolwp
    Member
    Plugin Author

    Posted 1 year ago #

    Glad you figured it out lizzy, I'll mark this as resolved now.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.