$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>plugins - Is there a way to get dynamic data into a Slider Revolution slide from a PHP script?|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

plugins - Is there a way to get dynamic data into a Slider Revolution slide from a PHP script?

matteradmin12PV0评论

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.

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.

Share Improve this question edited Jan 10, 2019 at 22:50 Timothy Fisher asked Jan 10, 2019 at 22:38 Timothy FisherTimothy Fisher 2181 silver badge11 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 2

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.

Post a comment

comment list (0)

  1. No comments so far