Skip to content

How do you use the GridPostArchive component #387

Discussion options

You must be logged in to vote

Hi @Auroraboreali-s As you see the error states that there is no getACFLayout() function in the component. This component is used only for archive page to showcase all posts. It is rendered on index.twig and getting all posts from query, its not build as flexible component. If you wish to make it flexible, you will need to refactor it and add function getACFLayout and then get all posts manually or with an acf field.

Example:

function getACFLayout()
{
    return [
        'name' => 'GridPostsArchive',
        'label' => 'Grid: Posts Archive',
        'sub_fields' => []
    ];
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Auroraboreali-s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants