WordPress.org

Ready to get started?Download WordPress

Forums

NextGEN Scroll Gallery
how to display a custom field (7 posts)

  1. marfer
    Member
    Posted 2 years ago #

    hi, I need to display the title and description, plus some custom fields that i've added with the "nextgen custom fields" plugin.
    I managed to make it display the title and description, but can't find the way to show the custom fields. Any suggestions?
    for example, if i add this call to ../plugins/nextgen-gallery/view/imagebrowser.php it works. <? Php echo $ image-> ngg_custom_fields ["your_custom_field_name"];?>

    http://wordpress.org/extend/plugins/nextgen-scrollgallery/

  2. marfer
    Member
    Posted 2 years ago #

    i figured it out extrapolating Shauno's explanation for smooth gallery
    http://wordpress.org/support/topic/plugin-nextgen-gallery-is-it-possible-to-specify-url-links-in-thumbnails?replies=13

    It's easy... you´ve to add $aux["pid"] = $picture->pid; on nggScrollGallery (around line 195) and then add nggcf_get_field($picture["pid"], "custom link") next to stripslashes($picture["title"]) (around line 278) , and that's it! :)

  3. shauno
    Member
    Posted 2 years ago #

    Hey
    Nicely done on figuring it out yourself. Glad the plugin helps you in some way.

    [ Signature moderated. ]

  4. Rockz0r
    Member
    Posted 2 years ago #

    Hey guys,

    I know I´m late but I can´t find "stripslashes($picture["title"])" on any line, and wanna use Custom fields to on the Scroll Gallery=/

  5. Rockz0r
    Member
    Posted 2 years ago #

    Well I added

    ...
    			$final = array();
    			foreach($pictures as $picture) {
    			$aux = array();
    			$aux["pid"] = $picture->pid;//added here
    			$aux["title"] = stripslashes($picture->alttext);
    ...

    there... but where to add the nggcf_get_field($picture["pid"], "custom link") ???

  6. Rockz0r
    Member
    Posted 2 years ago #

    sry guys got it, didnt checked that i use v2.0 of Scrollgallery :(

    Here the code with my customfield called "Gencode"

    ...
    foreach($pictures as $picture) {
     $getInformation = array();
     $getInformation["pid"]   = $picture->pid;
     $getInformation["title"] = stripslashes($picture->alttext); // $picture->alttext;
     $getInformation["desc"]  = $picture->description;
    ...
    if($useCaptions==true&&$useDesc==true&&stripslashes($picture["pid"])!="")
     $afterimg .='<div>'.nggcf_get_field($picture["pid"],"Gencode").'</div>';
     $afterimg .= '</div>';
    ...
  7. sylviamaan
    Member
    Posted 1 year ago #

    Hi, I see Marfer managed to display title and description. Marfer, how did you do that? I tried some things in nggScrollGallery.php, but no effect till now. Please can you or anyone else help me? Thanks in advance, Sylvia

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic