Support » Plugin: WP Job Manager » Listing Author

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Mike Jolley

    (@mikejolley)

    We don’t have a shortcode for this.

    You can make an author template file: https://codex.wordpress.org/Author_Templates then query an authors jobs with code similar to this:

    https://github.com/mikejolley/WP-Job-Manager/blob/master/includes/class-wp-job-manager-shortcodes.php#L146-L157

    Ok thank you i will try!

    Should be included with plugin though 🙂 just a suggestion 🙂 cheers

    Hello, i’m interessted in this template.(i’m begginer to wordpress)
    @Pacton did you succeed ?

    I tried without success. Here my code can you give me some hint

    <?php
    get_header();
    ?>
    
    <!-- #Content -->
    <div id="Content">
    	<div class="content_wrapper clearfix">
    
    		<!-- .sections_group -->
    		<div class="sections_group">
    
    <!-- This sets the $curauth variable -->
    <div class="section_wrapper clearfix">
        <?php
        $curauth = (isset($_GET['author_name'])) ? get_user_by('slug', $author_name) : get_userdata(intval($author));
        ?>
    
        <h2>About: <?php echo $curauth->nickname; ?></h2>
        <dl>
            <dt>Website</dt>
            <dd><a href="<?php echo $curauth->user_url; ?>"><?php echo $curauth->user_url; ?></a></dd>
            <dt>Profile</dt>
            <dd><?php echo $curauth->user_description; ?></dd>
        </dl>
    
        <h2>Jobs by <?php echo $curauth->nickname; ?>:</h2>
    
        <ul>
    <!-- The Loop -->
    <?php	
    
    add_action('author_page', 'author_page_function', $priority);
    
    function author_page_function( $atts ) {
    extract( shortcode_atts( array(
    			'posts_per_page' => '25',
    		), $atts ) );
    		wp_enqueue_script( 'wp-job-manager-job-dashboard' );
    		ob_start();
    		// If doing an action, show conditional content if needed....
    		if ( ! empty( $_REQUEST['action'] ) ) {
    			$action = sanitize_title( $_REQUEST['action'] );
    			// Show alternative content if a plugin wants to
    			if ( has_action( 'job_manager_job_dashboard_content_' . $action ) ) {
    				do_action( 'job_manager_job_dashboard_content_' . $action, $atts );
    				return ob_get_clean();
    			}
    		}
    	$args     = apply_filters( 'job_manager_get_dashboard_jobs_args', array(
    			'post_type'           => 'job_listing',
    			'post_status'         => array( 'publish', 'expired', 'pending' ),
    			'ignore_sticky_posts' => 1,
    			'posts_per_page'      => $posts_per_page,
    			'offset'              => ( max( 1, get_query_var('paged') ) - 1 ) * $posts_per_page,
    			'orderby'             => 'date',
    			'order'               => 'desc',
    			'author'              => get_current_user_id()
    
    		) );
    
    		$jobs = new WP_Query;
    
    		}?>
    
            <?php
    do_action('author_page'); ?>
    
    <!-- End Loop -->
    
        </ul>
        </div>
    		</div>
    
    		<!-- .four-columns - sidebar -->
    		<?php get_sidebar(); ?>
    
    	</div>
    </div>
    
    <?php get_footer(); ?>

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Listing Author’ is closed to new replies.