Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

dermattes on "PHP Value in Nextgen Shortcode"

$
0
0

Hello everybody!

I want to call a Nextgen Gallery via a shortcode. In this shortcode i want to put a php value which i get from a custom field.
The value and the shortcode work on its own, but the combination doesn't seem to work.

<?php
$nggid = the_field('gallerie');
$shortcode = "[ngg_images gallery_ids='{$nggid}' display_type='photocrati-nextgen_basic_slideshow']";
echo do_shortcode($shortcode);
?>

Gives out: "4Gallery not found. Please check your settings."
(the "4" is the custom field value)

Since i am not really literate in PHP, i hope that there is just a minor mistake that someone else can easily identify.

Thanks in advance!
Mattes


Viewing all articles
Browse latest Browse all 8245

Trending Articles