Can I implement post tags using html ?
-
Hello
I am creating a custom HTML template to use everytime I blog. Part of the template involves the tags of the post. I want the tags to automatically appear in that place. Yet I dont know how. I know that if I simply place
<?php the_tags(); ?>inside a post it will not work. So is there some short code that I can use with html to execute the tags?Thanx
-
You need to edit your theme for this.
Thank U my friend. But thats not what I want.
I basically write movie reviews. Everytime I have to write the movie keywords (genres) loke Drama, Action, etc. I dont want to write them for each movie in plain text, I want them to be automatically linked to the post tags the I attach to the post upon creating it. That is why I want some sort of code, where I place in the post (not the theme!), and there appear the list of tags.
I am thinking about a plugin called word linker or something like that, which, if am not mistaken, scans every post and converts every word (that I have previously assigned a link to), to a hyperlink poiint to the address that I set in the past. I might simply set the link of the Drama tag to the word “drama” using this plugin.. guess that would work.
Then what you need is your own shortcode to convert them for you, see the shortcode API here.
http://codex.wordpress.org/Shortcode_APIIn short, shortcodes are the right way for converting post content into actionable data… as appose to trying to execute PHP inside post content, which is just a recipe for problems in my personal opinion.
If you call the
the_tags()function inside the Loop (as you are supposed to and which requires editing the theme) you are automatically linking a list of tags to each post. You can easily insert tags either above or below the post content, for each individual post, this way. And what you say in one place is that you want is a “list of tags”.It is only if you want something more complicated that you should be thinking about shortcodes– like for example, you wish to convert tags mentioned in the content into clickable links. In that case, it the shortcodes you want, as t31os_ suggested. Maybe you want both functions.
Okay. What I want again, is , indeed calling the tags, but through the post, not the theme.
if I add the <?php the_tags(); ?> in single.php, the tags will load within the loop, in the place where I put the code. This happens everytime, IN THE SAME PLACE !
It is not what I want. I want to load the tags inside the post, but with a variable location. Sometimes at the beginng, sometimes middle, sometimes in the bottom. This is not fixed, it is changed almost everytime, according to the post’s content. So, I basically want some sort of a shortcode (if thats the correct name anyway), which I add to the post through the source view, and that code should load the tags of that post wherever I put it. Its just like the shortcode “coldform” functions for Perishable Contact Coldform plugin, which loads the contact me form in any page or post that shortcode is added.
I looked at that shortcode api, but I found nothing about converting php tag into html one.
Sometimes at the beginng, sometimes middle, sometimes in the bottom.
So you need shortcodes.
I looked at that shortcode api, but I found nothing about converting php tag into html one.
Yes. The API is there to give you guidance. You are going to have to write the actual code yourself.
I honestly read through it carefully. But understood nothing. I am not Matt Mullinwegg and my knowledge of PHP is very basic .. and I wish there is a simple shortcode that I would add to my posts .. if you can help me in that, I will appreciate it !
Perhaps you would prefer a plugin solution.
http://wordpress.org/extend/plugins/template-tag-shortcodes/It allows you to use template tags, like
the_tagsand various other things in the post.That way you don’t have to do any shortcode writing.
Oh… now that is slick.
I can’t say i’ve actually used it myself, but i’ve seen Justin’s work before, and it’s usually nothing short of ace, so i’d expect nothing less with this plugin.
iceq, if you need some help figuring how to use the plugin above to do what you want just let us know..
aaah thatx exactly what I am looking for π
Great plugin indeed, and a great t31os_.. I have just tested it and it works 100%
I really appreciate your help my friend. I wish I can help U sometime like you helped me:)A thank U for apljdi.. you too spared no effort .. I deeply admire your assistance folks.
Have some sunny nice days
The topic ‘Can I implement post tags using html ?’ is closed to new replies.