Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other WP Advanced Custom Fields Plugin

  • This topic is empty.
Viewing 15 posts - 1 through 15 (of 22 total)
  • Author
    Posts
  • #35432
    tobeeornot
    Member

    I’ve just set some new customs fields for images on a specific page using this plugin. Unfortunately , I seem to be getting a strange php error message on the wp back end page (screenshot) , and I am not sure why.

    I am using the following code on the relevant template to select the image but it isn’t working:

    On the selected page, the broken-image box, where the image should be, is misplacing the location set by the class.

    I have also tried the following code for calling the image on the template, which gets the location right but no image:

    image1
    #91752
    TheDoc
    Member

    Does this function allow you to put an array in it? Better off sticking with manually putting the class name in there.

    Maybe it’s not liking the space after the_field. Try this:

    image1
    #91753
    TheDoc
    Member

    It also might not like the period in your custom field name.

    #91756
    tobeeornot
    Member

    Yep, that is what I also tried but the image is not appearing (but the placement is right) and the weird error message on the wp back-end page is still there.

    #91804
    tobeeornot
    Member

    Ok, I uninstalled the plugin and reinstalled it and that seems to have cured the php error message. The problem now is that the custom fields display ‘no image selected’ after I have uploaded them. They also do not appear on the relevant page. Any ideas?

    For reference, I have set ‘Page Template’ as equal to ‘Home’ (the relevant page) on the custom fields rules.

    #91808
    TheDoc
    Member

    Hmmmm… not sure I can help much there without having access to the backend.

    #91810
    tobeeornot
    Member

    That’s ok, Doc. I am making some progress. I can now upload the images to the WP back-end but I can’t get them to display in on the the web-page.

    #91811
    tobeeornot
    Member

    Maybe my loop is incorrect? It would great if someone could take a look:






  • image1
    " class="button">View More












  • image2
    " class="button">View More








  • while ( have_posts() ) : the_post(); ?>



  • image3
    " class="button">View More








  • #91834
    tobeeornot
    Member

    I should add this is the code WP is outputting:

    image1

    So, it seems the uploaded images on the back-end are not being acknowledged by the front end.

    #91840
    tobeeornot
    Member

    Just got this feedback from the plugin developer:

    “You should have a look at this: http://plugins.elliotcondon.com/advanced-custom-fields/documentation/code-examples/#wpshdo_8

    Basically, when dealing with a custom loop, you need to enter the post ID as a second parameter, so ACF knows which object to get your values from.”

    Would appreciate it if anyone could help me alter the code accordingly.

    #91849
    TheDoc
    Member

    You could do:

    image3

    But I don’t think you should have to. I can look at the loops tomorrow!

    #91926
    tobeeornot
    Member

    Thanks Doc but that didn’t work. Could it be that I need to register the plugin in functions.php? Be much appreciated if you could look at my loop.

    #91927
    TheDoc
    Member

    No, the plugin shouldn’t have anything to do with functions.php.

    Can you take a screen shot of your edit screen? I’d like to see what the ACF fields look like that you’ve set up!

    #91931
    tobeeornot
    Member

    Edit Field Group Screenshot

    Home back-end Screenhot

    #91932
    tobeeornot
    Member
Viewing 15 posts - 1 through 15 (of 22 total)
  • The forum ‘Other’ is closed to new topics and replies.