• Resolved bügelfrei

    (@alexanderbailey)


    Can I control the order in which NPE prints the fields it gets from ACF?

    include_acf_fields='npe_nn_city_name, event_date' and include_acf_fields='event_date, npe_nn_city_name' are both printing first the date, and then the city name.

    I tried renaming the ACF fields to change their alphabetical order, but the order on my page remained the same.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author johnzenausa

    (@johnzenausa)

    No it’s not. You would change their order using CSS. Both grid and flex will work. What order would you like? I’m guessing you’d want the city first then the date. I’ll give you a couple of examples.

    First let’s say you want them vertical but the city first you would just add:

    .netsposts-acf-fields {
        display: flex;
        flex-direction: column-reverse;
    }

    If you want to use grid then it would be:

    .netsposts-acf-fields {
        display: grid;
        grid-template-areas:
            "span1"
            "span2";
    }
    .netsposts-acf-fields span:first-of-type {
        grid-area: span2;
    }
    .netsposts-acf-fields span:nth-of-type(2) {
        grid-area: span1;
    }
    Thread Starter bügelfrei

    (@alexanderbailey)

    You are good! Neither flex nor grid were in my CSS tool kit. Now they are. I went with flex as it seems like browser support has been around a bit longer.

    My test page has been updated to show what should be my final CSS and markup (I wrapped the titles in H3s).

    Mighty thanks!

    If I can help you out with proofreading and updating your documentation, give me a shout via my personal website (link in my WP profile). I’m much obliged.

    Plugin Author johnzenausa

    (@johnzenausa)

    I always appreciate proofreaders plus if you need css help don’t hesitate to ask. The reason I don’t mess with the order is because reordering is just as easy through CSS.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Order of ACF Fields?’ is closed to new replies.