Wednesday 13 February 2019

Quick Tip: WordPress “get” and “the” template functions


If you’re learning how WordPress templates work, there are two kinds of functions you’ll see a lot. What I like to call, the “get” and “the” template functions. If you haven’t noticed by now, there are functions in WordPress that seemingly do the same thing, so what is the difference? When do you use either one? Here are some examples: “Get” function
“The” function
I learned PHP through WordPress first, before I went on to solidify my PHP knowledge outside of it. If you’re in the same boat that I was, even if you’re not a beginner in other languages like HTML and Css, here is how I learned these functions.
“Get” Functions
The “get” functions will fetch the data I want, but the data will not display on the front-end by default. If I drop one of these functions, say “get_the_title” inside of a WordPress loop, I will not see the title on the front-end. For those who don’t know what I mean by front-end, I mean you won’t see it on your website. Which is confusing, right? At first, I was like, “Hey, I’m in the loop, and it’s supposed to get the title,
Source: https://managewp.org/articles/18377/quick-tip-wordpress-get-and-the-template-functions



source https://williechiu40.wordpress.com/2019/02/13/quick-tip-wordpress-get-and-the-template-functions/

No comments:

Post a Comment