Support » Plugin: File Away » Shortcode in template

  • Resolved groloff

    (@groloff)


    Hi there. Is it possible to invoque the shortcode from a template php file using the do_shortcode wordpress function?
    I´m using this code: echo do_shortcode(‘[fileaway type=”list” base=”1″]’);
    but it doesn´t work
    Any ideas?
    Thanks a lot

    https://wordpress.org/plugins/file-away/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author thomstark

    (@thomstark)

    Have you tried adding debug=on to your shortcode to make sure it’s pointing to a valid directory? Nothing will be output if there are no files.

    Plugin Author thomstark

    (@thomstark)

    Get it working? I’ve never had a problem with do_shortcode in a template. You can, of course, just call the function, and pass the attributes array to its argument, like this:

    $atts = array('type'=>'list','base'=>'1');
    echo sssc_fileaway($atts);

    But of course if those are your actual choices, they’re the defaults, so you could just call the function: echo sssc_fileaway();

    Plugin Author thomstark

    (@thomstark)

    Ever get this figured out or do we still need to troubleshoot?

    sorry thomstark. in the end I didn’t had to use a template shortcode. but no, i couldn’t get it to work. thanks anyway

    Plugin Author thomstark

    (@thomstark)

    I’ll look into this further as soon as I can.

    what i was trying to do was showing a list of the last 5 files uploaded trough FTP client to several subfolders of the base folder of fileaway. is this possible to do with file away?

    Plugin Author thomstark

    (@thomstark)

    It doesn’t filter by anything like most recent, but it can recurse into subdirectories with recursive turned on.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Shortcode in template’ is closed to new replies.