Viewing 4 reply threads
  • Author
    Posts
    • #5866
      alexadark
      Member

      Hi,
      i’m totally new to piklist, until now i was using ACF, and i wanted to switch to a library.
      i see lot of documentation to create the fields, but not how to display them in the frond end.
      Specially the add more fields, and also to make something similar to the flexible content, this is mandatory for me, i have seen it is possible here : https://piklist.com/support/topic/flexible-content-2/
      but how to display it ?
      where can i find exemples of codes already built ?

    • #5868
      Steve
      Keymaster

      @alexadark– Welcome to the Piklist community!

      The reason we don’t document displaying fields, is because Piklist does everything the WordPress way, so you can use standard WordPress functions to retrieve your data. For example, you can use get_post_meta() to retrieve your Post meta field data.

      To display that example of the Flexible Content field:
      1. Pull the data with a standard WordPress function like get_post_meta()
      2. The data will be returned as an array.
      3. Use a standard PHP foreach loop to loop through the data and display it.

      Does that make sense?

    • #5871
      alexadark
      Member

      yes, but it really would be nice to have examples anyway
      it’s ok for simple fields
      i still don’t know how to do for the flexible content thing
      do i write several foreach, do it need conditionals, i’m still not a php ninja, and having examples often allow me to understand, then to practice and become better
      if there where a premium version with clear examples and real step by step tutorials i would buy it immediately

    • #5892
      Steve
      Keymaster

      @alexadark– You are not the first one to ask for this. Hopefully over the next few weeks we can put together a tutorial on building flexible content fields.

    • #8416
      guanyixi
      Participant

      Here is a simple example:

      a field under meta-boxes

      piklist('field', array(
        'type' => 'text'
        ,'field' => 'page_title'
        ,'label' => 'Page Title'
      ));

      Display in front end

      <?php 
          $page_title = get_post_meta( get_the_ID(), 'page_title', true );
          echo $page_title;
      ?>
Viewing 4 reply threads
  • You must be logged in to reply to this topic.