![]() |
Convert to Integer in Template ?
I have a custom code named
Quote:
which works good but problem is Number of posts in some cases comes with Comma "," like 1,298 where it fails How can I simply convert to Integer in Template |
This is something that never really occurred to me until recently, and I'm afraid I've probably suggested to many people that they use $posts['post'] as an integer. In any case, I don't think there's any way to use that value in a conditional. What you could do is create a plugin using hook postbit_display_start and save the value to another name, like maybe:
Code:
$post['numposts'] = $post['posts']; The of course you'd use $posts['numposts'] in your template conditional. |
Good stuff kh99 ! lol..I found the thread you were talking about !
|
Quote:
|
All times are GMT. The time now is 10:06 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|