Hello,
I'm new to fansites and this forum so I hope I'm not doing anything wrong by writing here but I'm desperate about an issue happening on my fansite. I wanted to have the "latest images added to the gallery" in a sidebar's widget on my site, so I did everything I had to do with cpmfetch and it all went all as the CpmFetch Installer was showing me the thumbnails of the latest uploads in my gallery.
However, when I'm copying/pasting the code I'm given in the widget, here is what is appearing instead of the thumbnails :
cpm_viewLastAddedMedia(1,4); $objCpm->cpm_close(); ?>
Did I do something wrong ?
By the way, I have WordPress 4.5.2 and Coppermine 1.5.42 (stable) and my gallery is at roselesliesource.com/gallery/
Thank you !
That's an issue you probably have to ask in the Wordpress support board. Just to make sure, what code have you copied to the widget?
Alright thank you, should I post there : https://wordpress.org/support/forum/plugins-and-hacks ?
I have copied the second code :
<?php
include "./gallery/cpmfetch/cpmfetch.php";
$objCpm = new cpm("./gallery/cpmfetch/cpmfetch_config.php");
$objCpm->cpm_viewLastAddedMedia(1,4);
$objCpm->cpm_close();
?>
I'm no CPMFetch expert, but the code looks correct. I don't know how Wordpress handles custom PHP code in their widget functionality, but something goes obviously wrong, as everything after the first ">" is displayed as plain text. It seems Wordpress interprets that digit as closing PHP tag.
Please try to add that code to a new PHP file somewhere on your webspace, to make sure it works as expected.
Here are a few links that will help you solve your problem:
https://wordpress.org/plugins/php-text-widget/
https://wordpress.org/plugins/php-code-widget/
https://wordpress.org/plugins/enable-shortcode-and-php-support-in-text-widget/
http://www.wpstuffs.com/how-to-execute-php-code-in-text-widget-without-using-plugin/
Thank you so much, I used one of the plugin and it works now ! ;D