Title: PHP_Function Shortcode &#8211; Item_Number
Last modified: October 15, 2018

---

# PHP_Function Shortcode – Item_Number

 *  Resolved [signale](https://wordpress.org/support/users/signale/)
 * (@signale)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/php_function-shortcode-item_number/)
 * Hey, is there a way to get the post number in the loop when using PHP_Function
   Shortcode
 * I tried to pass the param from the APL screen – it passes the string, though 
   when returns it displays correctly, but when in the php mode – it interprets 
   as a string
 * Thanks
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fphp_function-shortcode-item_number%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Thread Starter [signale](https://wordpress.org/support/users/signale/)
 * (@signale)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/php_function-shortcode-item_number/#post-10782466)
 * Dah, used the global variable, sorry for the disturbing
 *  Plugin Support [Advanced Post List](https://wordpress.org/support/users/advancedpostlist/)
 * (@advancedpostlist)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/php_function-shortcode-item_number/#post-10783321)
 * Yea, WP Shortcodes only pass string params.
 * PHP does provide a few methods for converting a string to an integer. [Function intval](http://php.net/manual/en/function.intval.php)
   is one of the more common ones.
 *  Thread Starter [signale](https://wordpress.org/support/users/signale/)
 * (@signale)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/php_function-shortcode-item_number/#post-10784404)
 * Tried one, doesn’t work. It sees the value as a string(‘[item_number]’), converts
   it if you return it though, for exampke I did return $return .= $item_number.’
   Line’; and it actually displays as a number, but inside the custom function doesn’t
   work
 *  Plugin Author [EkoJR](https://wordpress.org/support/users/ekojr/)
 * (@ekojr)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/php_function-shortcode-item_number/#post-10791422)
 * That PHP function should convert the string to an int.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘PHP_Function Shortcode – Item_Number’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/advanced-post-list.svg)
 * [Advanced Post List](https://wordpress.org/plugins/advanced-post-list/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/advanced-post-list/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/advanced-post-list/)
 * [Active Topics](https://wordpress.org/support/plugin/advanced-post-list/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/advanced-post-list/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/advanced-post-list/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [EkoJR](https://wordpress.org/support/users/ekojr/)
 * Last activity: [7 years, 7 months ago](https://wordpress.org/support/topic/php_function-shortcode-item_number/#post-10791422)
 * Status: resolved