if i add this code <?php the_field('your_field_name', $post_id); ?>
i will get a static results, we need to generate the value every single time automatic in loop .
the code it work if i’m in the same page but when i go to homepage i did not get anything.
i’m sorry if i can’t explain what i mean,
but in simply i working on classifieds website and i need to put the value of the fields in the homepage with the post,
here is the code i use
<?php
class td_module_mx1 extends td_module {
function __construct($post) {
//run the parrent constructor
parent::__construct($post);
}
function render() {
ob_start();
?>
<div class="<?php echo $this->get_module_classes();?>">
<?php echo $this->get_image('td_356x220');?>
<div class="td-module-meta-info">
<?php echo $this->get_title();?>
<div class="td-editor-date">
<?php if (td_util::get_option('tds_category_module_mx1') == 'yes') { echo $this->get_category(); }?>
<span class="td-author-date">
<?php echo $this->get_author();?>
<?php echo $this->get_date();?>
</span>
</div>
</div>
</div>
<?php return ob_get_clean();
}
}
Thanks.
Hi Jhon,
the field located on page and i need to view the field in home page like the image in the link below,
http://goo.gl/bX8mWY
Thanks,
Wael.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.