WordPress.org

Ready to get started?Download WordPress

Forums

Media Category Library
[resolved] Long code (10 posts)

  1. TSSpkDev
    Member
    Posted 1 year ago #

    Hi,
    I'd like to put this into a template but I can't figure out how it would look in php. Can you help?

    [mediacat cats="Documents" orderby="date" order="DESC"]

    Thanks so much,

    Pamela

    http://wordpress.org/extend/plugins/media-category-library/

  2. timmcdaniels
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    You can add this to your template:

    <?php if ( method_exists( $media_cat_lib, 'get_mediacategory_shortcode' ) ): ?>
    <?php echo $media_cat_lib->get_mediacategory_shortcode( array( 'cats' => "Documents", 'orderby' => "date", 'order' => "DESC" ) ); ?>
    <?php endif; ?>
  3. TSSpkDev
    Member
    Posted 1 year ago #

    That's great - thanks to much for the quick response.

    I need to be more granular.

    What I really want is to output a bulleted list of titles with the link behind it.

    Is this possible w/ your plugin?

  4. timmcdaniels
    Member
    Plugin Author

    Posted 1 year ago #

    I will be releasing version 0.8 which will allow you to do the following:

    <?php if ( method_exists( $media_cat_lib, 'get_mediacategory_shortcode' ) ): ?>
    <?php $posts = $media_cat_lib->get_mediacategory_shortcode( array( 'returnposts' => 1, 'cats' => "PDF", 'orderby' => "date", 'order' => "DESC" ) ); ?>
    <ul>
    <?php foreach ( $posts as $rpost ): ?>
            <li><a target="_BLANK" href="<?php echo wp_get_attachment_url( $rpost->ID ); ?>"><?php echo get_the_title( $rpost->ID ); ?></a></li>
    <?php endforeach; ?>
    </ul>
    <?php endif; ?>

    Does that help with what you are trying to do?

  5. TSSpkDev
    Member
    Posted 1 year ago #

    Yes - it's exactly what I'd like to do.

    When do expect to release it?

    Thanks so much!

  6. timmcdaniels
    Member
    Plugin Author

    Posted 1 year ago #

    It was already released this morning.

  7. TSSpkDev
    Member
    Posted 1 year ago #

    It's up and running and perfect. Thanks you, thank you, thank you!

  8. timmcdaniels
    Member
    Plugin Author

    Posted 1 year ago #

    You are welcome! Thanks for using the plugin.

  9. TSSpkDev
    Member
    Posted 1 year ago #

    In your next round it would be fantastic to give the user an "order" field so they could choose the sort order.

    Really loving this! Thanks so much!

  10. manoelfilho
    Member
    Posted 9 months ago #

    How do I display the category and subcategory and not repeat the files? If I can only display subcategories is enough. Tank you!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic