WordPress.org

Forums

OpenHook
Thesis 2.0 + Openhook Box (5 posts)

  1. gera3d
    Member
    Posted 2 years ago #

    I cant for the life of me figure out why my php is not working inside the open box. Its not even giving me an error. Its just not showing up.

    Here is the code.

    <?php if(has_post_thumbnail()){ ?>
    ID, "ExternalURL", true); ?>">
    <?php the_post_thumbnail(); ?>

    <?php } else { echo "this isn't working"; } ?>
    <?php endwhile; ?>

    I am calling the featured image and giving it custom link. Any idea why its not workin in the box?

    http://wordpress.org/extend/plugins/thesis-openhook/

  2. BrazenlyGeek
    Member
    Plugin Author

    Posted 2 years ago #

    The second line of your code isn't valid PHP or is missing the first part of the line. You also have an endwhile call without a corresponding while call earlier in the code.

  3. gera3d
    Member
    Posted 2 years ago #

    Hey Brazenly,
    Thanks for follow up with me on this issue. I already figured out what I was doing wrong. This was the code I ended up using to get the featured image then do a custom link via custom fields.

    <?php global $post; ?>
    ID, 'url', TRUE) ?>">
    <?php if (has_post_thumbnail()) { the_post_thumbnail(); } ?>

  4. gera3d
    Member
    Posted 2 years ago #

    <?php global $post; ?>
    <a href="<?= get_post_meta($post->ID, 'url', TRUE) ?>">
    <?php if (has_post_thumbnail()) { the_post_thumbnail(); } ?>
    </a>

    whoops here is the right code.

  5. BrazenlyGeek
    Member
    Plugin Author

    Posted 2 years ago #

    Glad you got it sorted out! Thanks for sharing your code!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • OpenHook
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic