Bulgaria 1000

WordPress PHP Tags – What they can do for your theme?

WordPress PHP Tags – What they can do for your theme?

<p style=”text-align: justify;”>As you may already know WordPress is built upon a set of tags and functions that can be used on any WordPress based website to fetch content from your database and display it on the frontend. These tags do a lot of the heavy lifting for you, which means that you don’t need a whole lot of PHP knowledge to start building beautiful WordPress themes and websites from the get-go.<!–more–>The WordPress Codex website, found at<strong></strong>, has a full list of the tags and functions available for use within your theme. Here, we’ll go through some of the more simple, yet very useful functions that will turn a beginner into a WordPress pro in basically no time at all.</p>
<p style=”text-align: justify;”><strong>GET_THE_POST_THUMBNAIL()</strong> – This function is a real beauty.</p>
<p style=”text-align: justify;”>This can be used within the post or page itself but also on your archive page within a list of related links, as a background image for the post or page or just about anywhere that you can think of. get_the_post_thumbnail() uses the featured image meta box for its content. If you are planning on using this on a full width layout, make sure that your image is fairly large. In order to allow featured images for pages, see our list of customizations.</p>
<p style=”text-align: justify;”><strong>THE_TITLE()</strong></p>
<p style=”text-align: justify;”>This function may seem pretty simple. In fact it is, but when you push it to its limits you get a feel for what can be achieved with some very basic WordPress functions , a little imagination, and some time to explore. For example, how about creating a slider that populates itself with latest blog posts using get_the_post_thumbnail() and the_title() function to get it a label, sounds pretty snazzy! But why stop there…</p>
<p style=”text-align: justify;”><strong>THE_EXCERPT()</strong></p>
<p style=”text-align: justify;”>Adding the_excerpt() function to your archive page, latest news widget or slider, gives you and ideal way of dynamically populating an area of text, giving your site user a better idea of what your blog posts have to offer.</p>
<p style=”text-align: justify;”><strong>THE_PERMALINK()</strong></p>
<p style=”text-align: justify;”>This function creates a link to the specific blog post that is being focused upon with the loop. For the slider, we are conceptualizing the functions found here, this could work as a simple Read More button, as a way to link the post_title() to the post itself or as a way to link the entire slide to the resulting blog post.</p>
<p style=”text-align: justify;”>The the_permalink() function can also be used on archive pages to link featured images through to the post itself, giving a user more ways to reach your posts.</p>
<p style=”text-align: justify;”><strong>GET_THE_SHORTLINK()</strong></p>
<p style=”text-align: justify;”>Another underestimated function is get_the_shortlink(). This function can be added as simple text at the end of each blog post which will save your readers some time when sharing your content online – the easier you make it for your readers to share, the more likely your content is to be shared!</p>
<p style=”text-align: justify;”>Let’s delve a little deeper: our SVG social sharing icons within our list of customisations uses wp_get_shortlink() to dynamically populate the resulting Twitter post with a short link to the post itself. This uses less of the user’s tweet character limits, giving them more space for their own comment and makes the post more attractive to post than a two-line URL!</p>

Leave a Reply

Your email address will not be published.