• First, amazing plugin. thank you for this.

    Is it possible to use different templates when using the shortcode instead of the widget? or am I stuck with the default templates?

    update: Ah! I re-read the documentation and was able to put them in a blog folder “acfrpw-blog”. Is there a way to add the suffix in the shortcode so I could have different templates? ex. “acfrpw-latest”

    update 2: awww, looks like the sub-directory is hard coded. I guess all I can do is a feature request. Be able to put something like this template=”suffix” in the shortcode and having files in the blog direction named slug-name-suffix.

    great plugin though.

    https://www.ads-software.com/plugins/acf-recent-posts-widget/

Viewing 1 replies (of 1 total)
  • Plugin Author Rafa? Gicgier

    (@gicolek)

    Hey lies,

    You’re right it is hardcoded, but there is a workaround which requires some programming knowledge ??

    What you have to do is to create a new shortcode, say [tpl tpl=”directory”] and wrap the plugin’s shortcode with that new shortcode.

    Inside the shortcode’s function you’d have to make usage of the global variable which was assigned a value from the provided shortcode attribute.

    Then you could use the acf_rpw_get_template_part filter to hook into the plugin and modify the default directory it fetches the templates from dynamically.

    I’ll be able to provide you with a full sample after the weekend if you won’t make it.

    Regards,
    Rafal

Viewing 1 replies (of 1 total)
  • The topic ‘How to use template with shortcode?’ is closed to new replies.