WordPress WordPress Theme Development Adding a Blog to a WordPress Theme Coding the Blog Homepage

Jesse Brownstein
Jesse Brownstein
5,111 Points

When do you need to add 'get_' to a WordPress function?

I don't understand when 'get_' is required. Please help clarify!

1 Answer

Sue Dough
Sue Dough
35,797 Points

Good question.

get_ just GETS the information to perhaps store in a variable

the_ will print the information out

<?php the_content(); ?>

will output

Test content

VS

<?php get_the_content(); ?>

will output nothing


To use get and output

<?php $content = get_the_content();
echo $content; ?>

will output

Test content