Reading post content into a hidden field..?
-
I have created a custom post type titled “Tea” it is the default post layout. The value of “32” is entered into the WYSIWYG editor.
I am looking through the data and I’d like to echo the_content(); into an hidden field. Which then creates a number counter based on the value of that field.
At the moment I am just getting the value of “0”
My code for it is as follows :
<div class="tea-count"> <?php $args = array( 'post_type' => 'tea'); $loop = new WP_Query( $args ); while ( $loop->have_posts() ) : $loop->the_post(); echo ' <div id="counter"> <input type="text" name="counter-value" value="the_content();" /> </div>'; ?> <?php endwhile; ?> </div>
How do I get the value of 32, rather than 0?
That amount will change dependant on what the user inputs into the WYSIWYG editor.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Reading post content into a hidden field..?’ is closed to new replies.