WordPress.org

Ready to get started?Download WordPress

Forums

Resume Submissions & Job Postings
Job Postings Not Showing On Category Page List - Re (6 posts)

  1. grosner55
    Member
    Posted 1 year ago #

    I created a job posting and assigned it to the "Careers" category.
    While viewing the job posting, my theme displayed breadcrumb navigation that included the word "Careers", but clicking on this breadcrumb displayed a category listing without any jobPostings.

    My solution was to create a new Post (using just WordPress and Not the RSJP Post) and assign it to the same category ("Careers"). Then I inserted the jobPostings shortcode (e.g. [jobPostings orderby="(post_date)", order="(DESC)", archive="(Hide)"]) and everything works like a champ.

    http://wordpress.org/extend/plugins/resume-submissions-job-postings/

  2. kandrews
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    I see the problem.
    The custom post type is not being included in the WP_Query.
    I will see what I can put together and will get back to ya.

  3. kandrews
    Member
    Plugin Author

    Posted 1 year ago #

    Try adding this code to the resume-submission.php page in the plugin folder.

    Right above include( 'includes/functions.php' ); add:

    function rsjpToQuery( $query ) {
    	if ( ! is_preview() && ! is_admin() && ! is_singular() && ! is_404() ) {
    		if ( $query->is_feed ) {
    			// Do nothing
    		} else {
    			$my_post_type = get_query_var( 'pre_get_posts' );
    			if ( empty( $my_post_type ) ) {
    				$args = array( 'public' => true,
    							   '_builtin' => false );
    				$output   = 'names';
    				$operator = 'and';
    
    				$post_types = get_post_types( $args, $output, $operator );
    				// Add 'link' and/or 'page' to array() if you want these included.
    				$post_types = array_merge( $post_types, array( 'post' ) );
    				$query->set( 'post_type', $post_types );
    			}
    		}
    	}
    }
    add_action( 'pre_get_posts' , 'rsjpToQuery' );

    Hope this helps.

  4. kandrews
    Member
    Plugin Author

    Posted 1 year ago #

    Sorry, that code had an error. This code should be fine.

    function rsjpToQuery( $query ) {
    	if ( ! is_preview() && ! is_admin() && ! is_singular() && ! is_404() ) {
    		if ( $query->is_feed ) {
    			// Do nothing
    		} else {
    			$thePostType = get_query_var( 'post_type' );
    			if ( empty( $thePostType ) ) {
    				$args = array( 'public' => true,
    							   '_builtin' => false );
    				$output   = 'names';
    				$operator = 'and';
    
    				$postTypes = get_post_types( $args, $output, $operator );
    				// Add 'link' and/or 'page' to array() if you want these included.
    				$postTypes = array_merge( $postTypes, array( 'post' ) );
    				$query->set( 'post_type', $postTypes );
    			}
    		}
    	}
    }
    add_action( 'pre_get_posts' , 'rsjpToQuery' );
  5. rogmsoares
    Member
    Posted 1 year ago #

    Hello, I tried to use your code, however it gave me error on a line above where you indicated to place.
    This code is for the links to categories of work with WP Post of vacancies, correct?
    Can you help me?
    Forgive the English, I'm Brazilian.

  6. archiseek
    Member
    Posted 11 months ago #

    Ahhhh Works lovely - allows me to set up categories - tweek the category template to display excerpts only, and use the rss feed for categories too...

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags