New Custom Fields type

Posted in: Newspaper
Post count: 9

Hi
I have some custom field like author, label, caption, photo credit ..etc..
How do I add displaying all of them to the post and the blocks.
I need to replace the default author to new_author custom field.

Post count: 22421

Hi,
If you want to replace theme elements you need to use the custom field implementation method as specified here:
https://codex.wordpress.org/Custom_Fields and replace the theme elements from the theme files. (you will require coding skills for this): http://screencast.com/t/NNlYIGC3h
Thank you!

Post count: 9

Hi thank you.
I need some help. Please here I am trying to explain what I have done so far.
1. I have author custom field (relationship type)
2. I have added following code to loop-single.php

<div class=”td-module-meta-info”>
<?php if ($author = get_field(‘iat_author’)) { ?>
<?php foreach ($author as $author_post) { ?>
<div class=”top-post-author”>
ID); ?>”><?= __(‘By’) . ‘ ‘ . $author_post->post_title; ?><br />
</div>
<?php } ?>
<?php } ?>

its showing me the author name. when I click the author name it should be link author post ( or archive page) . I got
Ooops… Error 404
Sorry, but the page you are looking for doesn’t exist.

/index.php/iat_author/crissie-delvy/

which page may I do custom quarry and redirect to author.php and show me all the author related article .

Post count: 9

sorry this one is the right code i added

<?php if ($author = get_field(‘iat_author’)) { ?>
<?php foreach ($author as $author_post) { ?>
<div class=”top-post-author”>
ID); ?>”><?= __(‘By’) . ‘ ‘ . $author_post->post_title; ?><br />
</div>
<?php } ?>
<?php } ?>

Post count: 6535

Hi

You have to use a function which get post’s url. In wordpress this can be done using get_author_posts_url(): https://codex.wordpress.org/Function_Reference/get_author_posts_url

Hope this helps.
Thanks!

Viewing 5 posts - 1 through 5 (of 5 total)
The forum ‘Newspaper’ is closed to new topics and replies.