NooTheme Premium WordPress Theme › Forums › JobMonster › ACF variable Elementor
- This topic has 5 replies, 2 voices, and was last updated 1 year, 9 months ago by Jackie.
-
AuthorPosts
-
1 year, 10 months ago #1219871
Hello,
Is it possible to retrieve the _cover_image and _logo variables from the company page with Elementor in order to make visuals on the home page on companies because there is only a featured company widget?
Thanks
1 year, 9 months ago #1219888Hi.
Thank you for contacting us.
Do you want to customize the Noo Company Feature widget? Please let us know more about that, we will help you get more info about the Company.
Thanks.
1 year, 9 months ago #1219895Hello,
I would like to display in rotation x companies with their background image as well as their logo on top, the title of the company and the number of offers available
example : https://postimg.cc/XXz5mYXz
regards
1 year, 9 months ago #1219899Hi.
You need to add the function get_company_cover_image() to this file wp-content/themes/noo-jobmonster/framework/admin/noo_company.php under line 1042. This function use to get the company cover image.
public static function get_company_cover_image( $company_id = 0, $size = 'thumbnail', $alt = '', $args = array() ) { if ( empty( $company_id ) ) { return ''; } $size_key = is_array( $size ) ? implode( '_', $size ) : $size; if ( ! isset( self::$companies[ $company_id ] ) ) { self::$companies[ $company_id ] = array(); } if ( ! isset( self::$companies[ $company_id ][ $size_key ] ) ) { $class = apply_filters( 'noo_company_cover_image_class', '', $company_id ); $thumbnail_id = noo_get_post_meta( $company_id, '_cover_image', '' ); $size = is_numeric( $size ) ? array( $size, $size ) : $size; $args[ 'alt' ] = $alt; $args[ 'class' ] = isset( $args[ 'class' ] ) ? $args[ 'class' ] . ' ' . $class : $class; $company_cover_image = wp_get_attachment_image( $thumbnail_id, $size, false, $args ); if ( empty( $company_cover_image ) ) { $img_size = ''; if ( is_array( $size ) ) { $size[ 1 ] = count( $size ) > 1 ? $size[ 1 ] : $size[ 0 ]; $img_size = 'width="' . $size[ 0 ] . 'px" height="' . $size[ 1 ] . 'px"'; } $company_cover_image = '<img src="' . NOO_ASSETS_URI . '/images/company-logo.png" ' . $img_size . ' class="' . $args[ 'class' ] . '" alt="' . $args[ 'alt' ] . '">'; } self::$companies[ $company_id ][ $size_key ] = $company_cover_image; } return apply_filters( 'noo_company_cover_image', self::$companies[ $company_id ][ $size_key ], $company_id ); }
Then you can go to file: wp-content/plugins/jobmonster-addon/includes/elementor-template/noo-company/style-grid.php and use the function below to get the company cover image:
<?php echo Noo_Company::get_company_cover_image($post->ID, 'company-image'); ?>
Please recheck it.
Thanks.
1 year, 9 months ago #1219914Thanks, I can't get it to work 🙁
do you have to take the Noo Company Feature or Company List widget?
How to do random selection I don't have the function in the widget 🙁
1 year, 9 months ago #1219924Hi again.
Please give us your site URL, admin, and FTP account again. I'll help you add the custom function to get the company covers image to the widget company list.
Thanks.
-
AuthorPosts
You must be logged in and have valid license to reply to this topic.