NooTheme Premium WordPress Theme › Forums › JobMonster › Theme Adjustments
- This topic has 13 replies, 2 voices, and was last updated 5 years ago by dbcstrauss.
-
AuthorPosts
-
5 years, 1 month ago #1079772
Hi there Super Team,
a quick overview of my website:
It's a job portal for one company only, where the registered employers will be departments. Each team leader will take care of the applications regarding their department and only Human Resources is able to publish jobs. HR is able to control everything as admin to check if there's no open applications or messages to answer.
In short terms, this is the main functionality. So, in general, I've managed to make the theme work this way, but there's still a few things that I need to adjust. So I'm gonna put here the changes I would like to make and you tell me if they're possible or not:
- Remove 'Post Job' button from main Profile Menu
- In single Job Post page, repeat info that's in the header in the sidebar
- Resumes, in the wordpress admin page, create a field for internal notes (so HR could write notes of each resume privately)
Cheers,
Attachments:
You must be logged in to view attached files.5 years, 1 month ago #1079978Hi,
1. You can add these lines to Custom CSS:
.noo-topbar .noo-topbar-user .sub-menu li:first-child,.nav-item-member-profile .sub-menu > li:first-child {
display: none;
}
2. This field cannot be duplicated, because Job and company have different input fields
3. This problem need to custom source code. We are currently unable to help you customize this issue.
Best regards,
tb.
5 years, 1 month ago #1079987Nice, thanks.
About the 3th point, I understand of course. But is it asking too much, just to point me out in the right direction? Like, which files would I start to make such customization?
Thanks in advance.
Cheers,
Daniel C.5 years, 1 month ago #1080145Hi,
3. You can try with the steps:
- You go to Jobmonster -> Custom Field -> Resume tab and add a new custom field (eg: resume_note).
- You use CSS to hide this field on the frontend
- Adding custom columns to custom post types: You put these functions into the functions.php file
// Add the custom columns to the book post type:
add_filter( 'manage_noo_resume_posts_columns', 'add_resume_note_columns' );
function add_resume_note_columns($columns) {
unset( $columns['note'] );
$columns['note'] = __( 'Note', 'noo' );
return $columns;
}
// Add the data to the custom columns for the noo_resume post type:
add_action( 'manage_noo_resume_posts_custom_column' , 'custom_resume_note_column', 10, 2 );
function custom_resume_note_column( $column, $post_id ) {
switch ( $column ) {
case 'note' :
$note= noo_get_post_meta($post_id, '_noo_resume_field_resume_note');
echo $note;
break;
}
}
Hope it helps!.
Best regards,
tb.
5 years, 1 month ago #1080228Hi, great, that did the work. Tanks.
So I explored that code and wanted to put a field in quick edit to be easy to edit that field. I searched and found a few things and I achieved the following code. But it's not saving. Can you help me find where did I made a mistake?
<code>function noo_quickedit_custom_posts_columns( $posts_columns ) { $posts_columns['_noo_resume_field_resume_note'] = __( 'Notas', 'noo' ); return $posts_columns; } add_filter( 'manage_noo_resume_posts_columns', 'noo_quickedit_custom_posts_columns' ); function noo_quickedit_custom_column_display( $column_name, $post_id ) { if ( '_noo_resume_field_resume_note' == $column_name ) { $time_recorded = get_post_meta( $post_id, '_noo_resume_field_resume_note', true ); if ( $time_recorded ) { echo esc_html( $time_recorded ); } else { esc_html_e( 'N/A', 'noo' ); } } } add_action( 'manage_noo_resume_posts_custom_column', 'noo_quickedit_custom_column_display', 10, 2 ); function noo_quickedit_fields( $column_name, $post_type ) { if ( '_noo_resume_field_resume_note' != $column_name ) return; // $time_recorded = get_post_meta( $post_id, '_noo_resume_field_resume_note', true ); ?> <fieldset class="inline-edit-col-right"> <div class="inline-edit-col"> <label> <span class="title"><?php esc_html_e( 'Notas', 'noo' ); ?></span> <span class="input-text-wrap"> <input type="text" name="_noo_resume_field_resume_note" class="generatewpedittime" value=""> </span> </label> </div> </fieldset> <?php } add_action( 'quick_edit_custom_box', 'noo_quickedit_fields', 10, 2 ); function noo_quickedit_save_post( $post_id, $post ) { if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return; if ( $post->post_type != 'post' ) return; if ( ! current_user_can( 'edit_post', $post_id ) ) return; if ( isset( $_POST['_noo_resume_field_resume_note'] ) ) { update_post_meta( $post_id, '_noo_resume_field_resume_note', $_POST['_noo_resume_field_resume_note'] ); } } add_action( 'save_post', 'noo_quickedit_save_post', 10, 2 ); </code>
5 years, 1 month ago #1080241Hi,
You can try with this function:
function noo_quickedit_save_post( $post_id, $post ) {
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
return;
if ( ! current_user_can( 'edit_post', $post_id ) )
return;
if ( isset( $_POST['_noo_resume_field_resume_note'] ) ) {
update_post_meta( $post_id, '_noo_resume_field_resume_note', $_POST['_noo_resume_field_resume_note'] );
}
}
add_action( 'save_post_noo_resume', 'noo_quickedit_save_post', 10, 2 );
Best regards,
tb.
5 years, 1 month ago #1080265That, completely did the trick!
tinhbeng, you're like a god to me. Respect.
Cheers
Daniel C.
5 years, 1 month ago #1080558Hi, 1. You can add these lines to Custom CSS: .noo-topbar .noo-topbar-user .sub-menu li:first-child,.nav-item-member-profile .sub-menu > li:first-child { display: none; } 2. This field cannot be duplicated, because Job and company have different input fields 3. This problem need to custom source code. We are currently unable to help you customize this issue. Best regards, tb.
Hi,
as you advised me, I added those css lines to hide publish job button, but only now I've noticed that it hides the first button (Manage Resumes) from the applicants as well. Anyway to block companies from publishing jobs? I want Admin to be the only one able to publish jobs.5 years, 1 month ago #1080602Hi,
I think you will have to customize the code for this issue.
You can use the Child theme and customize for the following files:
- user-menu-collapsed.php (/wp-content/themes/noo-jobmonster/layouts/)
- top-bar.php (/wp-content/themes/noo-jobmonster/layouts/)
- user-menu.php (/wp-content/themes/noo-jobmonster/layouts/)
Best regards,
tb.
5 years, 1 month ago #1080640Hi tinhbeng,
thanks once more for a solution.
One question off-topic, now that I have to update theme, what's the best way to save all the changes I've made so far in the theme? I have child configured and active. Should I just keep those files aside, update the theme and then restore those files? Or there's an easier way?
Cheers
5 years ago #1080744Hi,
You should back up your theme before update the last new version.
If all your customizations are done on the child theme, you can update to the latest version without worrying too much.
If you have customized the original theme, you will need to back up the custom file before updating it. After the update is completed, you will update the files again.
Best regards,
tb.
5 years ago #1081436Hi there, a month ago tinhbeng helped me to create 'notes' field to add privately in published resumes. Only admin is able to add notes and read them. This is was done using functions.
If there's any chance, and if it's not too much complicated, and to complete this function, could you help to make the right function that would make these notes searchable?
I searched a bit around the web and found the following code, which I tried to make it work but, no juice...
<code><span>// Search custom post type</span> <span>function</span><span> extend_admin_search</span><span>(</span><span> $query </span><span>)</span> <span>{</span> <span>// Extend search for document post type</span><span> $post_type </span><span>=</span> <span>'document'</span><span>;</span> <span>// Custom fields to search for</span><span> $custom_fields </span><span>=</span><span> array</span><span>(</span> <span>"_noo_resume_field_resume_note"</span><span>,</span> <span>);</span> <span>if</span><span>(</span> <span>!</span><span> is_admin</span><span>()</span> <span>)</span> <span>return</span><span>;</span> <span>if</span> <span>(</span><span> $query</span><span>-></span><span>query</span><span>[</span><span>'post_type'</span><span>]</span> <span>!=</span><span> $post_type </span><span>)</span> <span>return</span><span>;</span><span> $search_term </span><span>=</span><span> $query</span><span>-></span><span>query_vars</span><span>[</span><span>'s'</span><span>];</span> <span>// Set to empty, otherwise it won't find anything</span><span> $query</span><span>-></span><span>query_vars</span><span>[</span><span>'s'</span><span>]</span> <span>=</span> <span>''</span><span>;</span> <span>if</span> <span>(</span><span> $search_term </span><span>!=</span> <span>''</span> <span>)</span> <span>{</span><span> $meta_query </span><span>=</span><span> array</span><span>(</span> <span>'relation'</span> <span>=></span> <span>'OR'</span> <span>);</span> <span>foreach</span><span>(</span><span> $custom_fields </span><span>as</span><span> $custom_field </span><span>)</span> <span>{</span><span> array_push</span><span>(</span><span> $meta_query</span><span>,</span><span> array</span><span>(</span> <span>'key'</span> <span>=></span><span> $custom_field</span><span>,</span> <span>'value'</span> <span>=></span><span> $search_term</span><span>,</span> <span>'compare'</span> <span>=></span> <span>'LIKE'</span> <span>));</span> <span>}</span><span> $query</span><span>-></span><span>set</span><span>(</span> <span>'meta_query'</span><span>,</span><span> $meta_query </span><span>);</span> <span>};</span> <span>}</span><span> add_action</span><span>(</span> <span>'pre_get_posts'</span><span>,</span> <span>'extend_admin_search'</span> <span>); </span></code>
Can you please help with this?
Cheers.
5 years ago #1081442Hi,
Why is $post_type = 'document' and not 'noo_resume' ?
5 years ago #1081486Hi tinhbeng,
don't ask me. In programming, I'm just a handyman 🙂
Anyway, that did the work. As always. Thanks a bunch.
Cheers,
Daniel C
-
AuthorPosts
You must be logged in and have valid license to reply to this topic.