From TranDanze:
<li>
<h2><?php _e('Random photo'); ?></h2>
<div align="center">
<?php
include "../cpmfetch/cpmfetch.php";
$objCpm = new cpm("/gallery");
$options = array( 'subtitle' => '%t');
$objCpm->cpm_viewRandomMedia(1,1, $options);
$objCpm->cpm_close();
?>
</div>
</li>
Great, this work fine not just in your sidebar, but in my wordpress page.
Question:
1. How to make all pictures and data images get displayed on the same size, i look to the example about CSS in the developer page, where to put the CSS, it is in my wordpress theme CSS?
2. If i would like to display 10 recently uploaded files, linked file name, how to do it. I found CFRSSGET but no further example on how to use it.
3. I've tried this code, but nothing appear?Anything wrong?
<?php
/*
Template Name: Test
*/
?>
<?php get_header();?>
<li>
<h2><?php _e('Random photo'); ?></h2>
<div align="center">
<?php
include "../cpmfetch/cpmfetch.php";
$objCpm = new cpm("/gallery");
$options = array( 'subtitle' => '%t' , 'imagewidth' => '70', 'imageheight' => '55', 'tablestyle' => "cssfortables" );
$objCpm->cpm_viewLastAddedMediaFrom(1, 5, "cat=1:album=3", $options);
$objCpm->cpm_close();
?>
</div>
</li>
<?php get_footer();?>
4. How to use cpmfetch functions in one page at different places?Because when i use the function say at the top of the page, and use it again at below of the page, it would say
Fatal error: Cannot redeclare class cpm in /home/dakwah/public_html/cpmfetch/cpmfetch.php on line 33
Example:
- cpfetch code for displaying last upload
<div align="center">
<?php
include "../cpmfetch/cpmfetch.php";
$objCpm = new cpm("/gallery");
$options = array( 'subtitle' => '%t');
$objCpm->cpm_viewLastAddedMedia(1, 7, $options);
$objCpm->cpm_close();
?>
</div>
- some wording
- cpmfetch code for displaying random files
<div align="center">
<?php
include "../cpmfetch/cpmfetch.php";
$objCpm = new cpm("/gallery");
$options = array( 'subtitle' => '%t');
$objCpm->cpm_viewRandomMedia(1,1,$options);
$objCpm->cpm_close();
?>
</div>
5. Why image for pdf data not displaying? The code not displaying the image, but linked file name