Open jenhooks opened 6 years ago
1781186-zen
Any news on this?
@hsk-it No; if there was, you'd see it here. :)
Is this looking at being added? It's a bit of a deal breaker for us at the moment in terms of getting a premium license.
1817102-zen
Any advanced with this issue? I don't see WPJM be compatible with Elementor :(
Any plans to implement this? It's a major deal breaker of buying a license.
For the archive page, that is enabled if current theme supports job-manager-templates
. I doubt we'll be change that requirement, but you just need to declare support for it in your theme (https://wpjobmanager.com/document/enabling-full-template-support/).
For the meta fields, follow the issue #1697. That issue could replace this one, but I'll keep it open for now just to track any other conflicts/requirements with Elementor.
@jom while declaring theme support enables the archive to exist in general, it doesn't seem to make the archive accessible to Elementor when creating Archive theme templates. Can you confirm this?
I'm not sure about third-party issues, but after you declare theme support, make sure you re-save your Permalinks in WP admin. For that archive page, we do it in a pretty standard way so I'm not sure how else that plugin would sniff for it.
Tracked this down. For whatever reason, Elementor Pro starts with the following query to find post types with valid archives:
array ( 'show_in_nav_menus' => true, )
WP Job Manager doesn't match that by default. The function is in their utils.php
file and is called get_public_post_types
, so you'd think they'd look for 'public' => true
instead, but what do I know.
I'll be filtering the WP Job Manager post type registration args for now, and that may be the long-term solution if altering the post type query on Elementor's end doesn't make sense to them.
Elementor Pro 2.4.5, FWIW. To make it work:
add_filter('register_post_type_job_listing', function($args) {
$args['show_in_nav_menus'] = true;
return $args;
});
@pojome on the above
Further update, when it comes to custom fields:
Elementor Pro specifically filters out any meta keys that begin with an underscore:
if ( '_' !== substr( $custom_key, 0, 1 ) ) {
$options[ $custom_key ] = $custom_key;
}
Which is...most WP Job Manager meta keys (by default). This is why they don't appear in the dropdown in Elementor's theme builder.
OMG @ethanclevenger91 you're a legend!
I've added the filter above and the listing custom post type is now showing in the Elementor template selection dropdown. Awesome.
Quick question regarding the second bit of code just above from 21 Mar, should I be also adding this string or any other code to enable the custom fields?
@Joe-Bloggs With the custom fields, you're actually kind of SOL. WP Job Manager prefixes its meta keys with underscores, which is WordPress core's de facto way of marking keys "private" (for example, underscore-prefixed keys don't appear in the post edit meta fields metabox).
Moving away from that via a migration in a later version of WP Job Manager is probably possible, though has a high potential of breaking BC, and is therefore unlikely. The next option would be if they added some kind of white-list filter in Elementor that allowed you to give it an array of meta keys to explicitly fetch. Not a bad idea, actually. @KingYes might be someone who can advocate for something like that. I may cross-post an issue to the Elementor repo.
@ethanclevenger91 Did you actually manage to make this work?
Tracked this down. For whatever reason, Elementor Pro starts with the following query to find post types with valid archives:
array ( 'show_in_nav_menus' => true, )
WP Job Manager doesn't match that by default. The function is in their
utils.php
file and is calledget_public_post_types
, so you'd think they'd look for'public' => true
instead, but what do I know.I'll be filtering the WP Job Manager post type registration args for now, and that may be the long-term solution if altering the post type query on Elementor's end doesn't make sense to them.
Elementor Pro 2.4.5, FWIW. To make it work:
add_filter('register_post_type_job_listing', function($args) { $args['show_in_nav_menus'] = true; return $args; });
Where does the above code actually get placed?
@gferguson1815 I haven't tested, but I presume it would work if you added it to your functions.php, a custom plugin, or even easier, by using https://wordpress.org/plugins/code-snippets/
If you'd rather not change how WP Job Manager registers its post types (my originally proposed solution) and avoid potential unexpected behavior there, it looks like you can also use an Elementor filter to achieve exposing the Job Listing post type:
add_filter( 'elementor_pro/utils/get_public_post_types', function($post_types) {
$jobs_cpt = get_post_type_object('job_listing');
$post_types['job_listing'] = $jobs_cpt->label;
return $post_types;
} );
@ethanclevenger91 The solution that you have put up works perfectly! Kudos to you, keep up the good stuff!
3961572-zen
@ethanclevenger91 thanks so much for posting this snippet. Works perfectly!
@ethanclevenger91 Thank you, thank you for sharing your solution!
If you'd rather not change how WP Job Manager registers its post types (my originally proposed solution) and avoid potential unexpected behavior there, it looks like you can also use an Elementor filter to achieve exposing the Job Listing post type:
add_filter( 'elementor_pro/utils/get_public_post_types', function($post_types) { $jobs_cpt = get_post_type_object('job_listing'); $post_types['job_listing'] = $jobs_cpt->label; return $post_types; } );
where i will used this code to show the custom field in elementor?
is i use in the wordpress function.php or anywhere else ?
4542809-zen:
I have noticed that there is a conflict with the jobs listing page when Elementor Pro is active. It appears that the formatting for the job listings is broken. Elementor Pro is one of the most popular plugins on wordpress and is important to my site however I would love if the job listings appeared correctly.
Compatibility request - Elementor.
5490671-zd-woothemes - Elementor.
5577731-zen - Similar issue with Avada
Support References
This comment is automatically generated. Please do not edit it.
If you'd rather not change how WP Job Manager registers its post types (my originally proposed solution) and avoid potential unexpected behavior there, it looks like you can also use an Elementor filter to achieve exposing the Job Listing post type:
add_filter( 'elementor_pro/utils/get_public_post_types', function($post_types) { $jobs_cpt = get_post_type_object('job_listing'); $post_types['job_listing'] = $jobs_cpt->label; return $post_types; } );
Appreciate this post is old now... but with PHP8 being mandated by our web hosts, when we update the PHP version this particular code snippet is now causing a problem (that stops single job posts being displayed on the front end. Removing the code snippet then impacts our ability to style the job posts too). Is that coincidence, or does this need to be updated to work with PHP8 please?
It's Working for me and I think it should be working another way but I didn't check because the first way working. so if anyone doesn't match with the first way then try this second way Enabling Full Template Support
5837181-zen for Elementor support
6171331-zen citing lack of Elementor support for cancellation
All this plugin really needs to work is for Elementor to change one line in their post type declaration: https://github.com/Automattic/WP-Job-Manager/blob/a2fbcb2f68734e2ec672f810786f20a38a4670d6/includes/class-wp-job-manager-post-types.php#L375
'show_in_nav_menus' => false,
Set it to true and you can use Theme Builder now. You still need to go into Elementor settings to use the page builder for the jobs post type. IDK why it was set to false, default is true. If the answer is to sell plugins I think that is the wrong reason.
A user in this forums thread wants to create custom listing pages using a page builder like Elementor. However, they note that while Elementor has the ability to "bring dynamic data through", WPJM's custom fields seem to be inaccessible.
Elementor support has advised that everything needs to be set to
(‘public’ => true)
andhas_archive
should also be set totrue
. They cite this documentation:https://elementor.com/blog/wordpress-custom-post-types/
Elementor support recommended we contact them directly on GitHub to work out compatibility, if this is something we'd like to pick up in the future.