• april

    (@aprilmaynard)


    I have this code on 55 posts in a particular category:

    [wpfilebase tag=form id=printerwoes /]
    [wpfilebase tag=list id=71 sort='>file_date' pagenav=1 num=-1 /]

    These two lines allow me to upload a file using a form designated for that particular page and then display all files uploaded to that directory.

    Is there any way to program the custom page template for this category to take a custom field entry (i.e. “printerwoes” and “71”) and insert it into the pasted code above?

    Instead of having to post those two lines and fill in the IDs on every single page, it would be so much easier to just put in some custom fields to handle it, no?

    Stupid question?

    The shortcode for my custom field plugin would be like so:

    [acf field="printerwoes"]

    I’m using Advanced Custom Fields and WP Filebase Pro

    Any suggestions, guys? I appreciate it – thanks!

    http://wordpress.org/plugins/wp-filebase/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter april

    (@aprilmaynard)

    I got it working with some help from a nice guy on the WordPress channel on IRC.

    The shortcode we came up with does not allow any sorting, but it works:

    <?php $value = get_field( “memos” ); echo do_shortcode(‘[wpfilebase tag=browser id=”‘. $value .'”]’);?>

    “memos” is the name of my ACF field.

    Can you share a link so I can see how it works?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Combining shortcode from WP Filebase and ACF in post template?’ is closed to new replies.