Top 5 Useful WordPress Template Tags

It’s good practice to use this code rather than hard coding links. If you hard code links (domain.com/original-path-to-link) then change permalinks for whatever reason (domain.com/new-path-to-link), you have to go back and recode every link manually. Using get_permalink(); is the solution. It keeps track of the Page/Post ID. To find out the id of a Page or Post, hover over the page/post and it should be visible in the status bar. Otherwise edit the page/post and you’ll see it in the url (www.domain.com/wp-admin/post.php?post=000&action=edit).

<?php echo get_category_link('00'); ?>

Same function as get_permalink() for cetegories. Make sure to use apostrophes around the ID. The wordpress codex has a complex method to achieve the same result instead.

<?php bloginfo('url'); ?>

Good to use in anything that links to your homepage such as your Header logo.

Related posts:

Post navigation

Your email address will not be published. Required fields are marked *

Comment

Name *

Email *

Time limit is exhausted. Please reload CAPTCHA.seven − = three

What Our Clients Are Saying

We gained a 3,958% Increase in Traffic. We climbed from (500) visitors/mo to more than (20,000) visitors/mo. Simple and straightforward... Thank you for the positive experience of an SEO service performed perfectly.

Victor, US Self Storage Locator

Your outstanding service consistently provides increased traffic, more sales, and a big ROI. Best decision we ever made!

Ed, Crowley Auto Transport

The rates are excellent,, the customer service is more than first-class, and I will surely recommend to others.