- This topic is empty.
-
AuthorPosts
-
December 2, 2011 at 11:17 am #35432
tobeeornot
MemberI’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:
December 2, 2011 at 12:12 pm #91752TheDoc
MemberDoes 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:
December 2, 2011 at 12:12 pm #91753TheDoc
MemberIt also might not like the period in your custom field name.
December 2, 2011 at 12:24 pm #91756tobeeornot
MemberYep, 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.
December 3, 2011 at 10:55 am #91804tobeeornot
MemberOk, 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.
December 3, 2011 at 2:40 pm #91808TheDoc
MemberHmmmm… not sure I can help much there without having access to the backend.
December 3, 2011 at 2:56 pm #91810tobeeornot
MemberThat’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.
December 3, 2011 at 3:25 pm #91811tobeeornot
MemberMaybe my loop is incorrect? It would great if someone could take a look:
" class="button">View More
" class="button">View More
while ( have_posts() ) : the_post(); ?>
" class="button">View More
December 4, 2011 at 3:59 pm #91834tobeeornot
MemberI should add this is the code WP is outputting:
So, it seems the uploaded images on the back-end are not being acknowledged by the front end.
December 4, 2011 at 5:21 pm #91840tobeeornot
MemberJust 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.
December 4, 2011 at 7:19 pm #91849TheDoc
MemberYou could do:
But I don’t think you should have to. I can look at the loops tomorrow!
December 5, 2011 at 12:36 pm #91926tobeeornot
MemberThanks 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.
December 5, 2011 at 1:17 pm #91927TheDoc
MemberNo, 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!
December 5, 2011 at 2:08 pm #91931tobeeornot
MemberEdit Field Group Screenshot
Home back-end Screenhot
December 5, 2011 at 2:11 pm #91932tobeeornot
Member -
AuthorPosts
- The forum ‘Other’ is closed to new topics and replies.