• Resolved whoaloic

    (@whoaloic)


    Hello,
    In my posts I use custom fields. Is there any chance to display custom fields value in the loop?
    Also I’d like to show first the date before the title.

    More generaly, is there any chance to use my own loop template?

    Best regards

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Bill Erickson

    (@billerickson)

    Yes, you can use template parts to define your own shortcode output: https://github.com/billerickson/display-posts-shortcode/wiki#using-template-parts

    Thread Starter whoaloic

    (@whoaloic)

    Thank you. I also need different outputs according to my categories. Is it possible to add a custom parameter “template” to output posts according to template name?

    Plugin Author Bill Erickson

    (@billerickson)

    The link above shows you three methods of defining the template.

    If your post display is always by category, then you could use the post’s category to determine the template.

    Alternatively, you could use the third method shown in the above link to manually specify the template used every time.

    Thread Starter whoaloic

    (@whoaloic)

    Thank you but it seems orderby rand and post per page attributes can’t work? I’d like to how one random post on my homepage.
    I use [display-posts category=”my-category” layout=”my-layout” orderby=”rand” posts_per_page=”1″].
    Then I use in my-layout.php the custom output.
    Could you confirm please?

    • This reply was modified 6 years, 3 months ago by whoaloic.
    • This reply was modified 6 years, 3 months ago by whoaloic.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Build my own loop template’ is closed to new replies.