You could modify the code below to do what you need, I believe:
<?php if ( method_exists( $media_cat_lib, 'get_mediacategory_shortcode' ) && method_exists( $media_cat_lib, 'get_media_categories' ) ): ?>
<?php foreach ( array_keys ( $media_cat_lib->get_media_categories( true ) ) as $cat ): ?>
<h4><?php echo $cat; ?></h4>
<?php echo $media_cat_lib->get_mediacategory_shortcode( array( 'cats' => $cat, 'orderby' => "date", 'order' => "DESC" ) ); ?>
<?php endforeach; ?>
<?php endif; ?>
Perfect!
Here is what I’m using:
<?php if ( method_exists( $media_cat_lib, 'get_mediacategory_shortcode' ) && method_exists( $media_cat_lib, 'get_media_categories' ) ): ?>
<?php foreach ( array_keys ( $media_cat_lib->get_media_categories( true ) ) as $cat ): ?>
<h4><?php echo $cat; ?></h4>
<?php $posts= $media_cat_lib->get_mediacategory_shortcode( array( 'returnposts' => 1,'cats' => $cat, 'orderby' => "date", 'order' => "DESC" ) ); ?>
<?php foreach ( $posts as $rpost ): ?>
<div><a target="_blank" href="<?php echo wp_get_attachment_url( $rpost->ID ); ?>"><?php echo get_the_title( $rpost->ID ); ?></a>(<?php echo get_the_date( $date_format, $post->ID ); ?>)</div>
<?php endforeach; ?>
<?php endforeach; ?>
<?php endif; ?>
Hi
thanks for a great plugin. I would like to do the same as TSSpkDev. I can not work out which file to modify. I thought it would be /views/shortcode.php but wherever I tried your code it di not work. Which file do I modify please?
Thanks again!
would not be better to have a list of files automatically?
with a url for each category?
be possible?
regards!