Support » Fixing WordPress » custom fields – adding images with links

  • I have Scott Reilly’s Get Custom Field Values (3.3.2) plugin installed. I have been using it for some time to add text to specified posts. And it has been working brilliantly.

    An example of what I’m trying to achieve is on the list at the top of this page: (URL purposely left unlinked in an attempt to prevent spammers) I would like to add the image of the book and the offsite link to more information on the book via custom fields rather than hardcoding it into the post (I had to use awkward CSS to try to position the image.)

    As you may have guessed, I know just enough about coding to get myself in trouble. I’ve stared, to no avail, at various tutorials including the codex sections on adding images using custom fields.

    This is as far as I’ve gotten by adding the image fields to the c2c_get_custom coding on my index page:

    `if (function_exists(‘c2c_get_custom’)) {
    echo c2c_get_custom(‘imageURL’, ‘<a href=”‘, ‘ ” title=”offsite link”>’); //not working
    echo c2c_get_custom(‘image’, ‘<img src=”/wp-images/’, ‘” class=”imgright” style=”border-style:outset;” /></a>’); // not working
    echo ‘<ul class=”post-meta”>’;
    echo ‘<li style=”height:0 !important; padding:0; margin:0; border:0 !important; list-style:none !important;background:#def; display:inline;”></li>’;
    echo c2c_get_custom(‘Date of Publication’, ‘<li>’, ‘</li>’);
    echo c2c_get_custom(‘Publication’, ‘<li class=”publication”><strong>’, ‘</strong></li>’);
    echo c2c_get_custom(‘Publication Title’, ‘<li class=”pubtitle”><strong><small>’, ‘</small></strong></li>’);
    echo c2c_get_custom(‘Publication Author’, ‘<li>By ‘, ‘</li>’);
    echo c2c_get_custom(‘Publication URL’, ‘<li><small>(<a href=”‘, ‘ ” title=”offsite link” class=”offsite”>learn more by following this link</a>)</small></li>’);

    Do I have to add those two lines somewhere else to get the custom fields to show in my posting admin area? Thank you for any guidance.

    E Morris

    WP3.5; Firefox18.0.2; WinXP

Viewing 2 replies - 1 through 2 (of 2 total)
  • Correction!! (sigh… proofreading is always a good thing, isn’t it?)

    The images are now showing up as expected. (I had the wrong path on for the image file)

    But I still do not see the new fields on handy list on the edit post page

    -E Morris

    WP3.5; Firefox18.0.2; WinXP

    Sigh. Another correction…

    The images are showing on the main page but when I go to the actual post, the image disappears.

    The Cookbook cover shows here

    But when going to the post itself, the cookbook cover disappears: and there is no sign of the coding of the image in the source code.

    Where have I misstepped?

    -E. Morris

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘custom fields – adding images with links’ is closed to new replies.