0

Hi I am creating site with ACF and other plugin (WP-Appbox). WP-Appbox allow me to add little download box of app with shortcode. shortcode is as follow. [appbox storename appid]. If I want to show chrome from google store I will add [appbox googleplay com.android.chrome] in post or theme. so my requirement is how can I manipulate storename value and app id. with advanced custom field. ex. there will be 2 acf field store-name and app-id so I can add those field values from editor to shortcode. and following code is added in single.php as of now I came to this.

$thestore = get_field('store-name');
$theapp = get_field('app-id');
echo do_shortcode("[appbox $thestore $theapp]"); 

but its not working.

0

try adding quotes around the values returned by ACF:

$thestore = get_field('store-name'); 
$theapp = get_field('app-id'); 
echo do_shortcode('[appbox "' . $thestore . '" "' . $theapp . '"]');

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.