pods-framework / pods

The Pods Framework is a Content Development Framework for WordPress - It lets you create and extend content types that can be used for any project. Add fields of various types we've built in, or add your own with custom inputs, you have total control.
https://pods.io/
GNU General Public License v2.0
1.07k stars 264 forks source link

Not able to display author in Pod List using custom template #7375

Open suityou01 opened 1 week ago

suityou01 commented 1 week ago

Description

Wordpress 6.6.2

Using pods to create custom content type.

I have a custom template like this

<div class="latestposts">
    <div>{@post_thumbnail}</div>
    <div class="postexcerpt">
        <div>{@post_title}</div>
        <div>{@post_excerpt}</div>
        <div class="tags">
            [each post_tag]
                <span class=newstag>{@title}</span>
            [/each]
        </div>
        <div>
            {@post_date}
        </div>
        <div>
            {@post_author, cc_get_the_author_display_name}
        </div>
    </div>
</div>

I have added a function to my functions.php using the theme file editor

function cc_get_the_author_display_name($userID) {
    return get_the_author_meta( 'display_name', $userID );
}

The output on the page is just the ID value of the author. It looks to me like the filter function is not even being called.

Version

3.2.7.1

Testing Instructions

  1. Install wordpress
  2. Install pods
  3. Add custom content type Supports: [x] Title [x] Editor [x] Author [x] Featured Image [x] Excerpt [ ] Trackbacks [ ] Manually Edit Custom Fields (can cause slow performance) [x] Comments [x] Revisions [ ] Page Attributes [ ] Post Formats [x] Quick Edit
  4. Create post or custom content type and publish.
  5. Add Custom Template as above
  6. Add Pods Item List to Page
  7. Add custom function to functions.php
  8. View content

Screenshots / Screencast

Author displayed a 1, not author name. Image

Possible Workaround

Site Health Information

No response

Pods Package

No response