Join our new community forum for support & discussion

Join Now

Home Support Themes JobHive Advanced Custom Fields Integration

Advanced Custom Fields Integration

  • Author
    Posts
  • mynameis

    Hello!

    I want to edit the page of the jobs with Advanced Custom Fields, everything works fine until i want to get it shown in the frontend of a job offer. I am able to display it around the listing location or created date but i can’t find where to put it in the code, so it appears right after the main text area.

    Thank you in advance.

    yevhen developer

    Please consider using the built-in custom field feature, you don’t have to use ACF – the built-in features are more lightweight and 100% integrated. Please try adding a custom attribute in Jobs/Attributes section, if you mark it as Editable it’ll appear in the job form https://help.hivepress.io/article/75-how-to-add-listing-attributes

    mynameis

    Thank you, I have already tested this, but i need the field(s) not in the sidebar but on the main part of the job offer page. At the moment I solved it with ACF shortcodes, but it would be much easier, if I could implement it directly into the code.

    yevhen developer

    Please try assigning attributes to the Page (secondary) area, then they will appear in the page content section. We will also add more areas and customization options to the built-in attributes.

    mynameis

    I added a screenshot for understanding, when i add it to the secondary area it appears in the red square, but i need something that appears in the green area (Screen 1).
    https://ibb.co/VMqFR5g
    And I would also need the possibility of putting something in the main area of the job offer, like the red area in the second screenshot.
    https://ibb.co/tbksLM4

    yevhen developer

    Sorry, there is no such display area as on the first screenshot yet, but it is possible with the code customizations. Please try this sample snippet to insert custom content at the top of the company profile page:

    add_filter(
    	'hivepress/v1/templates/vendor_view_page/blocks',
    	function( $blocks, $template ) {
    		return hivepress()->helper->merge_trees(
    				[ 'blocks' => $blocks ],
    				[
    					'blocks' => [
    						'page_content' => [
    							'blocks' => [
    								'custom_listings_text' => [
    										'type'    => 'content',
    										'content' => 'Your content here',
    										'_order'  => 1,
    								],
    							],
    						],
    					],
    				]
    			)['blocks'];
    	},
    	1000,
    	2
    );

    Regarding the second screenshot, please let me know if re-ordering sections works for you (so the attributes will appear below the Details menu), it is possible with a simple code snippet.

    mynameis

    Thank you very much for your help, i’m only struggling with the implementation of the code, so that i can display individual text for each company, i have this code from ACF but i can’t get it to work inside your snippet:

    <?php if( get_field('text_field') ): ?>
        <h2><?php the_field('text_field'); ?></h2>
    <?php endif; ?>

    For the second screenshot: your idea would be perfect, thank you!

    yevhen developer

    Please check this video tutorial https://youtu.be/LkojYp-8uwY

Viewing 8 posts - 1 through 8 (of 8 total)

New Reply

This forum has been archived and is no longer accepting new posts or replies. Please join our new community forum for support & discussion.