0

I would love to add more fields so I can add date, title and other information to Wp galleries..i wonder if there is a tutorial or guide you can recommend me guys?

I found a few ways to do it, but they seem to be old.

I need to show the galleries like this:

Image caption 1 caption 2 caption 3 and all should Link to a URL.

This plugin, does part of the job. But for some reason, I cant display the fields. Im trying to output the thing using a script that is published in the author's website. But I cant find the right way to define the images I want to show.

This is the code -without modifying- I can read it says to put the ID of images, but WHERE??? i dont know how to code that bit... can you help me ??

* Sample function to add to your theme or plugin. Calls abcfmlcf_get_images()
 * @param string $attachment_ids. Attachment ID or comma delimited list of IDs. Example: '121,122,123'
 * @param string $image_size. Example: 'thumbnail'
 */
function my_get_images( $attachment_ids, $image_size ){ 
   $attr = array(
      'include'     => $attachment_ids,
      'orderby'     => 'post__in',
      'size'        => $image_size
   );

   //Returns associative array of image URLs and other data.
   $images = abcfmlcf_get_images($attr);

   foreach($images as $img){
        $imgUrl = $img['imgUrl'];
        $w = $img['w'];
        $h = $img['h'];
        $alt = $img['alt'];
        $linkUrl = $img['linkUrl'];
        $linkTarget = $img['linkTarget'];
        $title = $img['title'];
        $cap1 = $img['cap1'];
        $cap2 = $img['cap2'];
        $desc = $img['desc'];
        $imgID = $gImg['imgID'];

       //Add your custom code here...
   }   
}

IF i PUT THIS code in a page template, it breaks.

:(

  • What have you coded so far? Please paste the code you have worked on so far. – Brad Dalton Apr 21 '15 at 13:55
  • I think I have found a plugin that solves this issue is called Media Gallery Custom Fields ! – dmtnexer Apr 21 '15 at 13:59
  • Im updating my question. – dmtnexer Apr 21 '15 at 14:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.