• Resolved GrblFF

    (@grblff)


    Здравствуйте. Делаю свой шаблон для отображения галереи. Хочу вывести под изображением его метку. Как это сделать? <?php echo $image->alttext ?> – it’s image name, <?php echo $image->description ?> – it’s image description. What variable to write to output tag images? Help please.

    https://wordpress.org/plugins/nextgen-gallery/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter GrblFF

    (@grblff)

    Hello. Do your template to display the gallery. I want to bring a picture of his mark. How to do it? <? php echo $image-> alttext; ?> – it’s image name, <? php echo $image-> description; ?> – it’s image description. What variable to write to output tag images? Help please.

    Plugin Contributor photocrati

    (@photocrati)

    @grblff – The $images variable does not hold that information and getting to it in the style of a NextGEN Legacy template may be a little involved. I have left a note for one of our developers to have a look when they have time.

    Thanks!

    – Cais.

    Thread Starter GrblFF

    (@grblff)

    Thank you for your attention to this matter. It was quite a shame to face it. There are variables and cannot be used.

    Plugin Contributor photocrati

    (@photocrati)

    @grblff – The data is available but will require one of our developers to review and provide the best approach to attaining it. The tags are just not “used” in the standard displays so they are not included in the $images object.

    Thanks!

    – Cais.

    Benjamin

    (@benjaminowens)

    To retrieve an images tags do this:

    $tags = wp_get_object_terms($image->pid, 'ngg_tag');

    This returns an array of WP_Term objects; iterate through them and display $term->name in your gallery template.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘tag for image’ is closed to new replies.