How to display job owner name on Jobs listings

Hi,

I am trying to add the job owners name onto jobs on the job board so users can see who has posted it before contacting.

1. I would like to display the name of the job owner on the single jobs page. Ideally this should link to the job owners public expert profile.

2. I would like to display the job owner name on the job board archive page under each listing.

Many thanks
Chris

  • Kasia Swiderska

    Hi chris,

    You can use functions get_the_author_meta() to display owner name in jobs. Like this

    <p><?php $user_name = get_the_author_meta( 'display_name' ); echo $user_name; ?></p>

    Here is full list of data you can get through this function https://codex.wordpress.org/Function_Reference/get_the_author_meta

    The views you want to edit are in plugin folder /app/views/job-single/main.php and /app/views/job-archive/main.php

    But I will ping developer to check if this can be done without modifying the pluging code.

    Kind regards,
    Kasia

  • chris

    Hi Kasia,

    Thanks for this. But this links to the public /author/[username]/ page.

    I would like to link it to a expert profile from the jobs&experts plugin.

    So for example i would like to link /expert/[expert name here]/
    e.g. http://twid.simplecsr.com/demo/expert/demo1-demo1/

    Could you please let me know if this is possible.

    (my sites only allow one expert profile for each user. But the Jobs&Experts plugin can have multiple expert profiles for each account ... i have never really understood the reason for this... but this could make it more complicated to target normally. But for my use each account will only have one expert page.)

    Many thanks
    Chris

  • chris

    Hi,

    No. Sorry for the confusion.

    I am using the plugin in the normal way - but i want people to be able to view a public profile about the job owner (linked to from the job if possible). Use case example is : On the basis I want to offer to help on a job, i would find it useful to know who has posted it so i know how to reply.

    I am not sure why - but the way the plugin seems to be configured - requires everyone contacting someone about a job to "Become Expert" before they can use the contact form.

    Can this be switched off? (So they can just contact the user without creating an expert profile first?)

    Originally there was/is no name of the person who has posted a job anywhere on a Job listing.
    We have now added that.

    I see though that jobs can be posted without an expert profile so some people may have posted a job but not have an expert profile, hence nothing to link to.

    If you could let me know if the need to set up an expert profile before contacting can be changed then i think it will work without a link to an expert profile.

    Many thanks
    Chris

    • Kasia Swiderska

      Hi Chris,

      I am not sure why - but the way the plugin seems to be configured - requires everyone contacting someone about a job to "Become Expert" before they can use the contact form.

      Hm. But that is purpose for this plugin. It connects "experts" with "jobs givers" - this is not the job board plugin like wpjobboard where everyone can apply for job.
      From the description "Help your users get more done by connecting jobs and professionals." - it is working the same way as the WPMU jobs board - only experts there can apply for jobs.

      I see though that jobs can be posted without an expert profile so some people may have posted a job but not have an expert profile, hence nothing to link to.

      The job owner is user in WordPress and his profile is just an author profile. They are not experts, so they don't have expert profile. But I think you could use the author profile instead. There is template in WordPress that you can change to look more like the "job owner" not the simple "author" - author.php.

      Let me know what do you think.

      Kind regards,
      Kasia

  • chris

    Hi,

    I have installed a new plugin to manange profiles instead of the expert listings.

    Instead of linking usernames to their profile pages I want to link to these new profile pages.

    I found this code that is used on the list of all profiles and wondered if it could be used to adapt the current code of:

    <a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>"><?php the_author(); ?></a>

    Can anything be taken from the code below to adpat this line and create a link to the new profile page from individual jobs? I cant see how to adapt

    $description = get_user_meta( $user->ID, 'description', true );
    $trimmed_description = wp_trim_words( $description, 12, '<a href="'. wpum_get_user_profile_url( $user ) .'"> ...'.__( 'View Profile', 'wpum' ).'</a>' );
    
    ?>
    
    <li id="wpum-single-user-<?php echo esc_attr( $user->ID ) ?>" class="wpum-single-user">
    
    	<a href="<?php echo wpum_get_user_profile_url( $user ); ?>"><?php echo get_avatar( $user->ID, 80 ); ?></a>
    
    	<div class="user">
    		<h3><a href="<?php echo wpum_get_user_profile_url( $user ); ?>"><?php echo $user->display_name; ?></a></h3>
    		<div class="description">
    			<?php if ( $trimmed_description ) : ?>
    				<small class="tagline"><?php echo $trimmed_description; ?></small>
    			<?php else : ?>
    				<small class="tagline"><?php _e( 'This user has not provided a description yet.', 'wpum' ); ?></small>
    			<?php endif; ?>
    		</div>
    
    		<?php do_action( 'wpum_directory_single_user', $user ); ?>
    
    	</div>
    
    	<div class="contact-meta">
    		<a href="mailto:<?php echo antispambot( $user->user_email );?>"><?php _e( 'Send Email', 'wpum' );?></a>
    		<?php do_action( 'wpum_directory_single_user_contact_meta', $user ); ?>
    	</div>
    
    	<ul class="meta">
    		<?php if ( $user->user_url ) : ?>
    		<li class="website"><a href="<?php echo esc_attr( $user->user_url ); ?>" target="_blank" rel="nofollow"><?php _e( 'Visit Website', 'wpum' );?></a></li>
    		<?php endif; ?>
    		<li class="registration-date"><strong><?php _e( 'Registered:', 'wpum' ); ?></strong> <date><?php echo date( get_option( 'date_format' ), strtotime( $user->user_registered ) ); ?></date></li>
    		<?php do_action( 'wpum_directory_single_user_meta', $user ); ?>
    	</ul>
    </li>

    Many thanks
    Chris

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.