soliloquy( the_field( 'slider' ) );
This is my code to add the ID for a slider from a ACF number field to a slider function call however it outputs the ID and doesn't execute the soliloquy function.
I think it might have something to do with the single qoutes.
Not sure how to wrap the slider ID in single qoutes
soliloquy( the_field( 'slider' ) );
This is my code to add the ID for a slider from a ACF number field to a slider function call however it outputs the ID and doesn't execute the soliloquy function.
I think it might have something to do with the single qoutes.
Not sure how to wrap the slider ID in single qoutes
Share Improve this question asked Oct 8, 2020 at 6:08 Brad DaltonBrad Dalton 6,9652 gold badges36 silver badges47 bronze badges2 Answers
Reset to default 1You need to use get_field() function instead. It will RETURN the value instead of printing. So, your code will be:
soliloquy( get_field( 'slider' ) );
This works but i prefer to use the ACF specific custom field function
soliloquy( get_post_meta( get_the_ID(), 'slider', true ) );