Title: [Plugin: Advanced Post List] Using shortcodes in List content section.
Last modified: August 20, 2016

---

# [Plugin: Advanced Post List] Using shortcodes in List content section.

 *  [jjyepez](https://wordpress.org/support/users/jjyepez/)
 * (@jjyepez)
 * [14 years ago](https://wordpress.org/support/topic/plugin-advanced-post-list-using-shortcodes-in-list-content-section/)
 * First of all, I want to publicly thank the developers of this amazing plugin.
   It’s just awesome for us developers.
 * That been said,
    I have figured out a way to insert shortcodes in the List content
   section, so you can enhance even more the power of this plugin.
 * Hope this is helpful for you guys.
 * —
 * 1.- Do the known to get [php_function name=”function_name” param=””] enabled 
   in the APL. Please refer to [(kalinbooks site)](http://kalinbooks.com/2011/custom-php-functions/).
 * 2.- Create a function in wp-config.php immediatly after defining the constant“
   KALINS_ALLOW_PHP” similar to the following:
 *     ```
       define("KALINS_ALLOW_PHP", true);
       function sh_code($post, $shcd){
          $shcd=str_replace('#','"',$shcd); //needed to parse " marks
          if(function_exists('do_shortcode')){
             $output=do_shortcode('['.$shcd.']');
          }else{
             $output="[error: do_shortcode function doesn't exist!]";
          }
          return $output;
       }
       ```
   
 * 3.- Use the [php_function name=”function_name” param=””] code like this -in the
   List content section-:
 *     ```
       [php_function name="sh_code" param="gallery id=#[ID]# size=#medium# columns=#3#"]
       ```
   
 * _NOTE: Pay special attention to the use of «[ID]» and «#» in the example .. «[
   ID]» is an APL code that is parsed before the param is._
 * Well, that’s it. I have successfully proven this so, This WORKS!
    Enjoy it!
 * Again, thanks to the authors of this amazing plugin.
 * Regards,
    — jjyepez
 * [http://wordpress.org/extend/plugins/advanced-post-list/](http://wordpress.org/extend/plugins/advanced-post-list/)

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

 *  Thread Starter [jjyepez](https://wordpress.org/support/users/jjyepez/)
 * (@jjyepez)
 * [14 years ago](https://wordpress.org/support/topic/plugin-advanced-post-list-using-shortcodes-in-list-content-section/#post-2801874)
 * <<< spanish translation – traducción al castellano>>>
 * Antes que nada me gustaría agradecer publicamente a los autores de este increible
   plugin. Es realmente genial para desarrolladores.
 * Dicho eso,
    He descubierto la manera de insertar shortcodes en la sección List
   content, con lo que se puede ampliar aún más el poder de este plugin.
 * Espero que este post sea de ayuda para todos.
 * —
 * 1.- Haz lo necesario para habilitar el uso de [php_function name=”function_name”
   param=””] en el APL. Detalles en [(sitio de kalinbook)](http://kalinbooks.com/2011/custom-php-functions/).
 * 2.- Crea una función en wp-config.php inmediatamente luego de definir la constante“
   KALINS_ALLOW_PHP”, similar a la siguiente:
 *     ```
       define("KALINS_ALLOW_PHP", true);
       function sh_code($post, $shcd){
          $shcd=str_replace('#','"',$shcd); //necesario para usar las "
          if(function_exists('do_shortcode')){
             $salida=do_shortcode('['.$shcd.']');
          }else{
             $salida="[error: la funcion do_shortcode no existe!]";
          }
          return $salida;
       }
       ```
   
 * 3.- Usa el código [php_function name=”function_name” param=””] de la siguiente
   manera -en la sección List content-:
 *     ```
       [php_function name="sh_code" param="gallery id=#[ID]# size=#medium# columns=#3#"]
       ```
   
 * _NOTA: Presta especial atención en el uso de «[ID]» y «#» en el ejemplo anterior..«[
   ID]» es un código propio de APL que es interpretado antes de param._
 * Bien, eso es todo! Lo he probado con éxito asi que, FUNCIONA!
    Que lo disfruten!
 * De nuevo, gracias a los creadores de este increible plugin.
 * Saludos,
    — jjyepez
 * [http://wordpress.org/extend/plugins/advanced-post-list/](http://wordpress.org/extend/plugins/advanced-post-list/)
 *  Plugin Author [jokerbr313](https://wordpress.org/support/users/jokerbr313/)
 * (@jokerbr313)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-advanced-post-list-using-shortcodes-in-list-content-section/#post-2802231)
 * This is a nice example of the plugin’s feature. If it’s alright with you, when
   I get around to making a proper wiki section, can I use this or use it as a reference?
   Considering you put the time into composing it, I figured it would be proper 
   to ask.
 * Thank you for posting this topic.
 *  Thread Starter [jjyepez](https://wordpress.org/support/users/jjyepez/)
 * (@jjyepez)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-advanced-post-list-using-shortcodes-in-list-content-section/#post-2802232)
 * Yes, of course you can use this the way you consider more useful for others.
   
   And thank YOU for creating this amazing piece! 🙂
 * Best regards,
    — jjyepez
 *  [Nightjar](https://wordpress.org/support/users/nightjar/)
 * (@nightjar)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-advanced-post-list-using-shortcodes-in-list-content-section/#post-2802286)
 * I have tried to use your PHP function along with [Easy Custom Content Types for WordPress](http://codecanyon.net/item/easy-custom-content-types-for-wordpress/234182?sso),
   but when I place the following code on a table:
 * `<td>[php_function name="sh_code" param="ecpt_field id=#data-consegna#"]</td>`
 * The data displayed on every column is the same – that is the data related to 
   the last entry repeated on all the fields of the same column.
 * Any idea on what’s wrong?
 *  Thread Starter [jjyepez](https://wordpress.org/support/users/jjyepez/)
 * (@jjyepez)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-advanced-post-list-using-shortcodes-in-list-content-section/#post-2802287)
 * Hi Nightjar,
 * Are you making a proper “custom type” selection on the Advanced Post List settings
   header?
    If so, as I can see, that short code “ecpt_field” is based on a different
   $post object var than the generic $post used in the loop ..
 * Remember that Advanced Post List uses a generic $post reference as shown in the
   example.
 * Perhaps, you should pass the ecpt_field shortcode the $post->ID that is currently
   received by the sh_code function.
 * Regrds & success,
    — jjyepez

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

The topic ‘[Plugin: Advanced Post List] Using shortcodes in List content section.’
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/)

## Tags

 * [function](https://wordpress.org/support/topic-tag/function/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [posts](https://wordpress.org/support/topic-tag/posts/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)

 * 5 replies
 * 3 participants
 * Last reply from: [jjyepez](https://wordpress.org/support/users/jjyepez/)
 * Last activity: [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-advanced-post-list-using-shortcodes-in-list-content-section/#post-2802287)
 * Status: not resolved