• Resolved roxanegunn

    (@roxanegunn)


    Hi there

    I’m a bit stuck and hoping you can help.

    I’ve managed to display my pods data on a WordPress page using a shortcode that calls a pod template that looks like this:

    <div class="streamer-container">
     <a class="streamer-pic" href="{@main_url}" target="_blank"><img src="{@profile_image}" /></a>
      <div class="streamer-blurb">
       <h3><a href="{@main_url}" target="_blank">{@post_title}</a></h3>	
       {@profile_blurb}
       {@external_links}
      </div><!-- streamer-blurb -->
      <br class="clear" />
    </div><!-- streamer-container -->

    I’ve just bought a license for Search & Filter which displays the results of the search in a file I named search-pods.php

    I’m guessing I can’t just paste the pods template with magic tags into search-pods.php page and expect it to work, but I also can’t use the default WordPress code that appears on search.php, or none of my custom fields are going to show up.

    So the question is: How do I express the pods template as php for that search page?
    Please will you let me know how to code it exactly, or at least point me to some reference (in layman’s terms) that will help me understand?

    • This topic was modified 6 years, 2 months ago by roxanegunn.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Jim True

    (@jimtrue)

    Hey @roxanegunn,

    I think you might have brought this to our Slack Chat yesterday but didn’t reference this forum question.

    You can call a Pods Template _inside_ a Loop by using https://pods.io/docs/code/pods/template/

    Inside the loop, you can call against the global $post and call your template like:

    echo pods('streams',$post->ID)->template('Stream List');

    Search & Filter should give you an example of the search.php content they need and you just have to locate the Loop

    Hope this helps!

    Thread Starter roxanegunn

    (@roxanegunn)

    Thank you Jim

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Search Results Code’ is closed to new replies.