Viewing 7 replies - 1 through 7 (of 7 total)
  • While I’m not sure what issue you’re having, sndomingue, I’m sure it isn’t related to the plugin. I use this plugin along with custom fields without a problem.

    Plugin Author dFactory

    (@dfactory)

    Just make sure your image link have rel="lightbox" attribute.

    Isn’t the purpose (or one of the purposes) of this wonderful plugin to automatically add the rel attribute, so that we don’t have to add it to all the pictures ourselves?

    Plugin Author dFactory

    (@dfactory)

    Sorry, but I can’t imagine any functionality doing that.

    Alright.. I solved the problem by adding rel="lightbox" to all image links by running the custom field content through this before printing it out:
    preg_replace('/<a(.*?)href="(.*?).(bmp|gif|jpeg|jpg|png)"(.*?)>/i', '<a$1href="$2.$3" rel="lightbox">', $string)

    I have the exact same problem, so thanks for a solution Fabian. It sounds like what I need.
    But I can’t get it to work. Where should this code go? In functions.php? or somewhere in the template where I call my custom field? I am still quite a novice on php, so any help would be appreciated!

    Yeah you would place it in the template where you call your custom field. So the code I posted, replace $string with your custom field (would probably be something like $post->yourcustomfield

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Not working with Custom Fields’ is closed to new replies.