WordPress.org

Ready to get started?Download WordPress

Forums

Advanced Custom Fields
Can't display fields on index.php (2 posts)

  1. CoryDobson
    Member
    Posted 1 year ago #

    I'm trying to display 2 fields on the blog page of a site I'm developing, but they don't seem to post. This is what my code looks like:

    <?php if (get_field('blog_description')) { ?>
                    <h2><?php the_field('blog_heading') ?></h2>
                <?php } ?>
    
    			<?php if (get_field('blog_description')) { ?>
                    <div id="blogMainDescription">
                        <?php the_field('blog_description') ?>
                    </div>
                <?php } ?>

    I've used the same code on other template files for other pages, and they work fine, but I can't seem to get it working on the index.php file. Is there a specific way to post on the index.php file?

    For an example, see the following pages:

    Working page (same code, different field names): http://prodynamo.ca/wordpress/services/

    Non working page (triple checked field names): http://prodynamo.ca/wordpress/blog/

    Thanks in advance

    Cory

    http://wordpress.org/extend/plugins/advanced-custom-fields/

  2. Audee
    Member
    Posted 1 year ago #

    I have the same problem with Cory here.
    I don't know how to display custom field on index.php

    It will be nice if the plugin author will update the tutorial in the future for this purpose.

    Thank you!

    Cheers,
    ~ A u d e e

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.