How to display a php variable from every post in a WordPress loop -
I have a custom post type, and in each post I have a variable named In my template for posts, I have this: Grand total: 543 Now, on the second page, I run a loop of all the positions and the How can I pull this variable? Can I store Thank you for your help! P> Update with the Answer strong> If anyone needs it, then this is the last code used on the correct answer given below. P> And then in the loop, I called it with it: p> yes ........ p> and to pull p> $ grandtotal The value of
$ grandtotal is the result of calculating the data recorded on a frontend form on the post.
? & Gt; For example:
$ of each post The liability needs to display the value of not all your content - the title of the post with just
$ grandtotal code> in the database, so I can drag it into the loop? I'm not sure how to do this. P>
& lt ;? Php if ($ grandtotal) {add_post_meta (get_the_ID (), 'grandtotal', $ grandtotal, true) or update_post_meta (get_the_ID), 'grandolate', $ granultol); }; ? & Gt; Code> pre>
& lt; Php echo get_post_meta (get_the_ID (), 'grandtotal', true); ? & Gt; Code> pre> div>
< Code> update_post_meta ($ postid, meta_key, value); Like Update_post_meta (232, "_Grantola", 200); Code> pre>
$ value = get_post_meta (232, "_ grandotel"); Code> pre> div> html>
Comments
Post a Comment