Using Advanced Custom Fields to call in our slider into your theme

⚠️ Warning: To be able to follow the steps of this tutorial, you are required to have coding knowledge. Regretfully we can't provide support for custom coding. If you can't achieve what you are looking for or if you're not sure how to follow the instructions, hire a developer. We are also unable to provide support for problems happening because of custom codes.

If you would like to add our slider to your theme, you could use the Advanced Custom Fields plugin to do this. First what you would need to do is to create a custom Smart Slider 3 type field.

Then at your post use that field to identify our slider, for example you could put the shortcode of the slider there.

After this Advanced Custom Fields offers a get_field function to read out the data from your field, and WordPress has a do_shortcode function, which can be used to run shortcodes in your theme's files. You can use these functions in your theme:

<?php
  $slider = get_field("smart_slider_3");
  if($slider){
      echo do_shortcode($slider);
  }
?>

The if($slider) is correct, because if you didn't give anything to that field, it will return "false".

And you could even extend this, because in most themes there is a common posts page, and this custom field is called in from there too, so in case you would only want the slider on the page, where the actual post is, then you should also use the is_single function:

<?php
  $slider = get_field("smart_slider_3");
  if($slider && is_single()){
      echo do_shortcode($slider);
  }
?>
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.