Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
suityou01 opened this issue Nov 4, 2024 · 0 comments
Open

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

suityou01 opened this issue Nov 4, 2024 · 0 comments

Comments

@suityou01
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant