WordPress.org

Support

Support » Plugins and Hacks » [Plugin: Resume Submissions & Job Postings] Job Postings Not Showing On Category Page List – Re

[Plugin: Resume Submissions & Job Postings] Job Postings Not Showing On Category Page List – Re

  • grosner55
    Member

    @grosner55

    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/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author kandrews
    Member

    @kandrews

    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.

    Plugin Author kandrews
    Member

    @kandrews

    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.

    Plugin Author kandrews
    Member

    @kandrews

    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' );
    rogmsoares
    Member

    @rogmsoares

    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.

    archiseek
    Participant

    @archiseek

    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…

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: Resume Submissions & Job Postings] Job Postings Not Showing On Category Page List – Re’ is closed to new replies.