Dynamic Data

  • Solved
  • Posted 1 month ago

Hello. I couldn’t find any information about @site().query_var() and value() in the guides. I see how you use value() in the lessons, but I’m not entirely sure what else can be done with this functionality. Could you please provide some examples of working with this data?

Look, I’ve created a JSON output of API data on my website, which is processed by my code and displayed on the site via a shortcode. I have a question: how can I make the shortcode area only appear for a specific user role? Or only on the pages of those objects for which the data is in the JSON? For example, I have statistics by country, but some countries don’t have data. In this case, I could write a code that would output “0” so that I could configure the visibility of the entire “don’t show if equals 0” block. But I don’t know how to implement this, since the shortcode won’t work for conditions in dynamic data.
Thank you.