How to get value of Template Tag?
-
Hello.
The problem is that functionality of Template Tags is very limited. So I often need to enchance this functionality. But I can’t do this because they OUTPUT their data to the generated document. But I need to PROCESS this data, and then output. I need to implement logic based on the values of template tags.
Simple example. I can display the number of comments by the following code:
comments_number('No comments yet', 'One comment', '% comments' );
The problem is that in Russian language I need 4 forms of this message (not 3) with more complex dependence on the number of comments:
0: Нет комментариев
1: Один комментарий
2: 2 комментария
…
4: 4 комментария
5: 5 комментариев
…
20: 20 комментариев
21: 21 комментарий
…Other example: I do not want link to the comments when there is no comments. But the comments_popup_link(”, ‘1’, ‘%’); still output link with empty text to the document when there is no comments.
And so on…
THE QUESTION IS: How to get value of the tag instead of printing it to the document?
- The topic ‘How to get value of Template Tag?’ is closed to new replies.