How can I add a BTN with an attribute as the link?

I have an attribute called url, and I’m adding this button on the sidebar of the listings page
what happens is that the URL will get the data form the attribute, but I don’t know how to get the data form attributes
here’s how it looks right now

add_filter(
    'hivepress/v1/blocks/page',
    function( $args ) {
        return hivepress()->helper->merge_arrays(
            $args,
            [
                'blocks' => [
                    'before' => [
                        'type'    => 'content',
                        'content' => '<div class="my-custom-wrapper">',
                        '_order'  => 1,
                    ],
                    'after'  => [
                        'type'    => 'content',
                        'content' => '</div>',
                        '_order'  => 1000,
                    ],
                    'custom_button' => [
                        'type'    => 'content',
                        'content' => '<a href="' . get_post_meta( get_the_ID(), 'url', true ) . '" class="hp-listing__action hp-listing__action--review hp-link"><i class="hp-icon fas fa-link"></i> LINK</a>',
                        '_order'  => 4,
                    ],
                ],
            ]
        );
    }
);

``

Thank you for waiting. Please edit this URL attribute in Listings/Attributes and set this Display Format Style the URL attribute as a button (display format) #hivepress #attributes · GitHub

Also, it is possible to choose an area where you want to show this attribute. This setting in the Areas option in the Display section when you edit an attribute

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.