WordPress.org

Ready to get started?Download WordPress

Forums

Advanced Custom Fields
[resolved] Doesn't Work with Page Template (4 posts)

  1. rgoins
    Member
    Posted 1 year ago #

    I can't get get_field or the_field to work on any page that has custom page template associated with it. For example, with my theme my home page and blog page use custom templates. If I change these pages to use the default template then the codes work fine but when I use a page template the codes quit working. How can I fix this?

    The site is http://pr-you.com.

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

  2. rgoins
    Member
    Posted 1 year ago #

    I found the code messing it up but I don't know why.

    <?php if ( !is_archive() ) { ?>
    <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts('paged='.$paged.'&cat='.$cat); ?>
    <?php } ?>
  3. simco
    Member
    Posted 1 year ago #

    I'm having a similar related issue. Do you have Chrome and the developer tools plugin? If so, pull up the javascript console and tell me what the error message is when you encounter that problem.

    My issue is the admin area is broken due to a conflict somewhere with the ACF plugin and the error returned is specific to the page_template action. I'm curious what yours says.

  4. jrichardsMav
    Member
    Posted 1 year ago #

    put this after you close the if

    <?php wp_reset_query(); // reset the query ?>

    That should fix it

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic