Tagged: 

Viewing 3 reply threads
  • Author
    Posts
    • #4193

      I want to enable oEmbed for Wistia for my CPT developed using standard Piklist stuff. I have enabled embeds for Wistia using a plugin, which works…for standard posts/pages. In my CPT, I don’t use the standard genesis loop (so yes, using Genesis). It looks like this:

      
      function user_guide_setup() {
      
      		//* Remove the default Genesis loop
      		remove_action( 'genesis_loop', 'genesis_do_loop' );
      
      		//* Add user guides
      		add_action( 'genesis_loop', 'display_user_guide_items' );
      
      }
      
      function display_user_guide_items() {
        $postId = get_the_ID();
        $guide_items = get_post_meta($postId, 'user_guide_item', false);
        piklist(get_stylesheet_directory() . '/piklist/addmore-templates/user_guide_item', array('data' => $guide_items, 'loop' => 'data'));
      }
      
      genesis();
      

      This works, except for the embed. I followed the guide on this page http://www.kevinleary.net/oembed-excerpts-custom-fields/, but this does not work.

      I have no idea how to get the result that piklist spits out to be able to filter it, so what do I do?

    • #4194

      Figured out a hack, but would really like to know what the better approach is. My hack, in the add-more template:

      
      <?php
      $data = apply_filters('the_content', $data);
      ?>
      <div class="p2-guide-section">
          <div class="flexible-widgets guide-area">
            <div class="wrap">
              <section class="">
                <p><?php echo $data; ?></p>
              </section>
            </div>
        </div>
      </div>
      
    • #4196
      Steve
      Keymaster

      @fredrikcarlen– Welcome to the Piklist community!

      Why do you think this is a hack? Looks fine to me.

    • #4200

      OK, then, if you say so 🙂

Viewing 3 reply threads
  • The topic ‘How to enable oEmbed for CPTs developed using Piklist?’ is closed to new replies.