0

I have a PHP class that I'm using to make requests to an external API for data like view/follower counts.

I want to show a couple pieces of that data on my homepage in a Slider Revolution slide.

There aren't any default layers that I can put in to execute PHP code or anything like that that I have found. I know that there is a custom JS area, where I could potentially make an AJAX request to a script that instantiates the class and returns data from it.

But I'm not sure how I would implement that data within the slide.

1

Was easier than I thought, didn't know that you could execute shortcodes in the text/html block.

function twitch_api_client_views_shortcode() {
    $twitch = twitch_api_client();
    return $twitch->getViewCount();
}
add_shortcode( 'twitch-views', 'twitch_api_client_views_shortcode' );

And then [twitch-views] in Slider Revolution text/html layer.

|improve this answer|||||

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.