Can we call post format files in custom post widget?

Asked on August 2, 2016 in Development.

How to call post format files in custom post widget.

inkcolor Layers User
Reply
  • Possible Answers to Your Question:

  • 1 Answer(s)
    Answered on August 5, 2016.

    Hi there,

    I can’t give you a specific walkthough, but here are the basics:

    1. Enable post formats in your plugin:
    https://codex.wordpress.org/Post_Formats

    2. Add the format argument to the query array anywhere you need to specify a format:
    https://codex.wordpress.org/Class_Reference/WP_Query#Taxonomy_Parameters

    Here is an example of where thr query args are in the post widget: https://github.com/Obox/layerswp/blob/master/core/widgets/modules/post.php#L186

    3. To give folks a drop-down where they can select the format, duplicate the existing category select, or just ensure the format taxonomy is being added to the existing taxonomy array as a tax to load. https://github.com/Obox/layerswp/blob/master/core/widgets/modules/post.php#L636

    Reply