Support » Plugin: EG-Attachments » Display ONLY attachments with value higher than X in caption field

  • Jerome


    I would like to use the plugin EG-Attachments to display a list of attachments , where the caption value exceeds X and then orderby=caption DESC,

    I currently have EG-Attachments set to display 3 attachments per post that is looped on category.php, and I have the orderby set to caption DESC , so my attachments will display on screen in order below (each new line is the caption from an attachment)


    Now, I want to display ONLY captions that are greater than, say, 2010. This would mean that from the results I showed you above, I would now display


    Can someone make this possible? I have all of my options configured on the EG-Attachments options page in the admin panel and I call the EG-Attachments inside a loop on category.php using this code:

    <?php echo do_shortcode(‘[attachments size=custom orderby=”caption DESC” force_saveas=false]’); ?>

Viewing 1 replies (of 1 total)
  • Plugin Author emmanuelg



    A possible solution can be use orderby="caption DESC" and limit=2 (or 3).

    Another solution is hacking the plugin:

    In file, add 'caption_filter' => '' in the definition of $EG_ATTACHMENT_SHORTCODE_DEFAULTS (near line 83)

    in file, replace the conditions in lines 365 to 367, with

    if ( ($doctype == 'all' ||
    ($doctype == 'image' && $mime_type == 'image') ||
    ($doctype == 'document' && $mime_type != 'image') ) &&
    ($caption_filter=='' || ($caption_filter!='' && strcmp($attachment->post_excerpt,$caption_filter)>0)) ) {

    Of course, no help, no support on this…

Viewing 1 replies (of 1 total)
  • The topic ‘Display ONLY attachments with value higher than X in caption field’ is closed to new replies.