How to use this ? I get an error
-
Hi,
I still don’t understand how to set this up.
Previously, it was simply putting the code between insert_php. For example, I use the code below to fetch pictures from an external database to show in wordpress. I used this code in the post https://www.astrasuite.com/astrablog/pathos-ethos-integrated-amplifier/, works perfectly. I use a similar code in many posts.
[insert_php]
include “../client-system-albums/cpmfetch/cpmfetch.php”;
$objCpm = new cpm(“../client-system-albums/cpmfetch/cpmfetch_config.php”);
$objCpm->cpm_unlock_private(true);
$options=array(imagesize => “thumb”, imagelink => “large”, imagewidth => “128”, imageheight => “128”, windowtarget => “_blank”, “alttag” => “{{pTitle}}”, “tablestyle” => “center-css-table”, “cellstyle” => “center-text”);
$objCpm->cpm_viewLastAddedMediaFrom (“album=331”,30,5,$options);
$objCpm->cpm_close();
[/insert_php]So, how to use this in the new PHP Snippets ? I was thinking, am I supposed to create/add a new snippet, and put the code which is in between insert_php into this snippet ? Then later call it with [wbcr_php_snippet id = “xxx”] ?
I tried, but when I clicked on Publish, it came out with an error :
Don’t Panic
The code snippet you are trying to save produced a fatal error on line 2:Class ‘cpm’ not found
The previous version of the snippet is unchanged, and the rest of this site should be functioning normally as before.If I publish it including both the opening and closing insert_php, it gets published without any error. It doesn’t work though with the insert_php included in the snippet.
Thanks
The page I need help with: [log in to see the link]
- The topic ‘How to use this ? I get an error’ is closed to new replies.