WordPress.org

Ready to get started?Download WordPress

Forums

Magic Fields 2
Group funciton simply doesn't work... (9 posts)

  1. Kahil
    Member
    Posted 2 years ago #

    First...I like most of what this plugin does...with that said... The wiki and instructions aren't that great. I can get single items to display just fine. The issue I am having is getting groups to display. I have a group that can be duplicated. Following the wiki, with some edits, I can get it to call the groups...but...it doesn't display anything in the fields. The only thing that gets displayed is the word(s) 'Array'.

    So... How do I get it to work? Here's what I have...again, the only thing it is displaying is the word 'Array', which is nothing that is in my fields.

    <?php
            $fields = get_group('invoice'); // the 8 is the PageID
            foreach($fields as $field){?>
                    <?php echo $field['invoice_title']; ?>
    
            <?php } ?>

    http://wordpress.org/extend/plugins/magic-fields-2/

  2. Kahil
    Member
    Posted 2 years ago #

    Well... got it to work.. Will share the code shortly for anyone's future reference.

  3. rocomu8
    Member
    Posted 2 years ago #

    could you please share this code with me? What I'm trying to do is the following: I created 2 groups under a custom post type (Leadership) and I want the 2 groups to display separately within the Archive page for Leadership. Let me know if this makes sense...

    Will your code help with this? Let m know asap.

    Thanks.

  4. PHPanos
    Member
    Posted 2 years ago #

    Kahil: Did you really take a look at the wiki?

    This line:
    <?php echo $field['invoice_title']; ?>

    Should be:
    <?php echo $field['invoice_title'][1]; ?>

  5. Kahil
    Member
    Posted 2 years ago #

    Yes, I did look at the wiki. And I got it to work like I said in my reply above that you overlooked before replying. I just forgot to post the code.

    Do you get why people have questions like this about the plugin? Go look at the wiki again. Half is in another language, which makes it difficult to understand. Some of what is in English is written poorly. The wiki really needs to be updated to make it easier to figure out. Better descriptions wouldn't hurt either.

  6. PHPanos
    Member
    Posted 2 years ago #

    I didn't say it was the best wiki. But this is your second(?) issue you write about when both issues are documented in the wiki. Just saying... And it took me like 1 minute to find the solution to your problems in their wiki.

  7. Kahil
    Member
    Posted 2 years ago #

    And again, eventually found it, but it wasn't explained well and half of it is in another language. Can't get upset when people have questions like this when the wiki is as it is. If you take a little time to update it, I promise you that people will have less questions like this.

  8. PHPanos
    Member
    Posted 2 years ago #

    I didn't mean to sound harsh. I just thought that this was a basic function which you should easily find out how it works by looking at the wiki. I don't have time to update their wiki, I'll leave that to them :P

  9. eastbank
    Member
    Posted 2 years ago #

    Just an FYI on the wiki - use google translator, it does a good job of translating the portions that are in spanish. Just paste the URL into the translator and it will do the whole page.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic