Inside of an archive page I have multiple boxes. In those boxes I want to add a star rating, but I don't want to create a separate post for each of these boxes, I only want to make the boxes manually. All the star rating plugins want to fetch the post ID, but I don't want a post ID, I only want to apply the function in an isolated instance.
I also want multiple functions outputted in the same archive page (in this case, multiple star ratings on the same archive page).
Also, the post I am outputting in is not even a post or a page. In fact it is technically an archive page, which never actually displays any posts but instead various boxes inside the page, but not any posts.
One thing I tried was to specify a nonexistent post id like 99999999991, a number which would never become a real post id (since I won't write a billion blog posts). However, that didn't work, it just told me that that ID didn't exist.
Here is an image which shows some boxes with stars so you have a visual:
What this page is, is an archive page. That is, it is the page the is visible when you visit the category URL like, mywebsite.com/category. Normally, I could display some posts in a loop for that category on the archive page. But here I am not doing that, I just put in some boxes into the category archives page.
Basically all the boxes which are just PHP/HTML boxes I want to apply a star rating, manually, or really I want to be able to apply any shortcode in an isolated instance. Rather than applying to a post.
As for the code, here is the code I used:
<?php echo do_shortcode('[ratings id="99999999991"]'); ?>
In this shortcode, is it for a star rating plugin, and the shortcode allows you to display the star rating for any post id using
The shortcode doesn't work because it says, "no post with that ID". When I just try
<?php echo do_shortcode('[ratings]'); ?> it displays the empty stars image, but it doesn't do anything when I try to click and actually if I try to rate one box all the boxes stars are affected at the same time and give the error.
I also tried using advanced custom fields (ACF plugin):
<?php the_field('star_rating'); ?>
star_rating here is, is in advanced custom field I have the star ratings plugin for ACF and I created a custom star ratings advanced custom field and named it
The ACF code doesn't work because it gives me an error since it isn't contained in any loop and isn't being applied to any specific post.
Both of these code examples will work, if used in a post. However, I want to use without and actual post, just by itself.
How can I apply wordpress functions which require to fetch a post ID, without actually having a post ID to specify for it (especially because I want multiple inside the page and it isn't really a page or a post but it's an archive page)?