- Messages
- 2
- Likes
- 0
- Points
- 1
Hi,
I just switched from [insert_php] to a php snippet (with plugin Woody snippet)
But I cannot get the expected result.
I would like to insert php code in a page, but echoing a shortcode from another plugin (pdp personnal database) is not used,
when I use this code:
$sort = $_GET['sortby'];
if ( "$sort" == "" ) {
$sort = "no_affil";
}
$order="asc";
if ( "$sort" == "date_updated" ) {
$order="desc";
}
echo "[pdb_list template=club search='true' orderby='$sort' order='$order' fields='discipline,logo,no_affil,departement,url,email,contact,telephone,date_updated']";
I get the following on my page:
[pdb_list template=club search='true' orderby='no_affil' order='asc' fields='discipline,logo,no_affil,departement,url,email,contact,telephone,date_updated']
it shows that the php code is run successfully (variables $sort and $order are replaced) but shortcode "[pdb_list_template..]" is not interpreted.
Can you please help me finding the correct syntax for the php snippet code ?
I just switched from [insert_php] to a php snippet (with plugin Woody snippet)
But I cannot get the expected result.
I would like to insert php code in a page, but echoing a shortcode from another plugin (pdp personnal database) is not used,
when I use this code:
$sort = $_GET['sortby'];
if ( "$sort" == "" ) {
$sort = "no_affil";
}
$order="asc";
if ( "$sort" == "date_updated" ) {
$order="desc";
}
echo "[pdb_list template=club search='true' orderby='$sort' order='$order' fields='discipline,logo,no_affil,departement,url,email,contact,telephone,date_updated']";
I get the following on my page:
[pdb_list template=club search='true' orderby='no_affil' order='asc' fields='discipline,logo,no_affil,departement,url,email,contact,telephone,date_updated']
it shows that the php code is run successfully (variables $sort and $order are replaced) but shortcode "[pdb_list_template..]" is not interpreted.
Can you please help me finding the correct syntax for the php snippet code ?