admin管理员组文章数量:1130349
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 badges1 Answer
Reset to default 2Was 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.
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 badges1 Answer
Reset to default 2Was 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.
本文标签: pluginsIs there a way to get dynamic data into a Slider Revolution slide from a PHP script
版权声明:本文标题:plugins - Is there a way to get dynamic data into a Slider Revolution slide from a PHP script? 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749024028a2304819.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论