• Resolved tylererdie

    (@tylererdie)


    Hello,

    I have spent hours looking through articles and trying to understand what everyone means by single-job_listing.php

    <?php
    	global $avia_config;
    
    	/*
    	 * get_header is a basic wordpress function, used to retrieve the header.php file in your theme directory.
    	 */
    	 get_header();
    
    	$title  = __('Blog - Latest News', 'avia_framework'); //default blog title
    	$t_link = home_url('/');
    	$t_sub = "";
    
    	if(avia_get_option('frontpage') && $new = avia_get_option('blogpage'))
    	{
    		$title 	= get_the_title($new); //if the blog is attached to a page use this title
    		$t_link = get_permalink($new);
    		$t_sub =  avia_post_meta($new, 'subtitle');
    	}
    
    	if( get_post_meta(get_the_ID(), 'header', true) != 'no') echo avia_title(array('heading'=>'strong', 'title' => $title, 'link' => $t_link, 'subtitle' => $t_sub));
    
    ?>
    
    		<div class='container_wrap container_wrap_first main_color <?php avia_layout_class( 'main' ); ?>'>
    
    			<div class='container template-blog template-single-blog '>
    
    				<main class='content units <?php avia_layout_class( 'content' ); ?> <?php echo avia_blog_class_string(); ?>' <?php avia_markup_helper(array('context' => 'content','post_type'=>'post'));?>>
    
                        <?php
                        /* Run the loop to output the posts.
                        * If you want to overload this in a child theme then include a file
                        * called loop-index.php and that will be used instead.
                        *
                        */
    
                            get_template_part( 'includes/loop', 'index' );
    
                            //show related posts based on tags if there are any
                            get_template_part( 'includes/related-posts');
    
                            //wordpress function that loads the comments template "comments.php"
                            comments_template();
    
                        ?>
    
    				<!--end content-->
    				</main>
    
    				<?php
    				$avia_config['currently_viewing'] = "blog";
    				//get the sidebar
    				if(is_singular( 'job_listing' )) {
      				 // nothing
    				} else {
       				get_sidebar();
    				} 
    
    				?>
    
    			</div><!--end container-->
    
    		</div><!-- close default .container_wrap element -->
    
    <?php get_footer(); ?>

    – Is a copy of my single.php ,

    Demo page is https://www.verspeeten.com/VCTest/job/contracting-owner-operators/ – I do not want a sidebar or a gray line or anything appearing.

    – Please help me.

    https://www.ads-software.com/plugins/wp-job-manager/

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

    (@mikejolley)

    single-job_listing.php is a template file you can create which would apply to jobs only.

    You can base it on single.php or page.php.

    Your pages don’t have sidebars, so perhaps base it on that. If you need help with styling and template files, the theme author may be able to help you further.

    Thanks

    Thread Starter tylererdie

    (@tylererdie)

    You keep saying that… But where does single-job_listing.php go? root dir? , theme dir? – I take the page.php contents copy and paste them into this new page? how do I specify where the jobs get posted to?

    Plugin Author Mike Jolley

    (@mikejolley)

    The root of your active theme. Where you see page.php, single.php etc etc.

    https://codex.www.ads-software.com/Template_Hierarchy

    I take the page.php contents copy and paste them into this new page?

    Yes, then adjust the code if needed.

    how do I specify where the jobs get posted to?

    You don’t need to, it’s automatic.

    Thread Starter tylererdie

    (@tylererdie)

    <div class="single_job_listing" itemscope itemtype="https://schema.org/JobPosting">
    	<meta itemprop="title" content="<?php echo esc_attr( $post->post_title ); ?>" />
    
    	<?php if ( $post->post_status == 'expired' ) : ?>
    
    		<div class="job-manager-info"><?php _e( 'This listing has expired', 'wp-job-manager' ); ?></div>
    
    	<?php else : ?>
    
    		<?php
    			/**
    			 * single_job_listing_start hook
    			 *
    			 * @hooked job_listing_meta_display - 20
    			 * @hooked job_listing_company_display - 30
    			 */
    			do_action( 'single_job_listing_start' );
    		?>
    
    		<div class="job_description" itemprop="description">
    			<?php echo apply_filters( 'the_job_description', get_the_content() ); ?>
    		</div>
    
    		<?php if ( ! is_position_filled() && $post->post_status !== 'preview' ) : ?>
    			<?php get_job_manager_template( 'job-application.php' ); ?>
    		<?php endif; ?>
    
    		<?php
    			/**
    			 * single_job_listing_end hook
    			 */
    			do_action( 'single_job_listing_end' );
    		?>
    
    	<?php endif; ?>
    </div>

    So this code goes where?

    Plugin Author Mike Jolley

    (@mikejolley)

    Where are you even getting that from – you’re pasting from page.php to single-job_listing.php. The code above is not needed.

    Thread Starter tylererdie

    (@tylererdie)

    Ok I am taking page.php – copying all the contents and making new file called single-job_listing.php placing it into

    /wp-content/themes/enfold

    – Now what?

    <?php
    global $avia_config;
    
    	/*
    	 * get_header is a basic wordpress function, used to retrieve the header.php file in your theme directory.
    	 */
    	 get_header();
    
     	 if( get_post_meta(get_the_ID(), 'header', true) != 'no') echo avia_title();
    	 ?>
    
    		<div class='container_wrap container_wrap_first main_color <?php avia_layout_class( 'main' ); ?>'>
    
    			<div class='container'>
    
    				<main class='template-page content  <?php avia_layout_class( 'content' ); ?> units' <?php avia_markup_helper(array('context' => 'content','post_type'=>'page'));?>>
    
                        <?php
                        /* Run the loop to output the posts.
                        * If you want to overload this in a child theme then include a file
                        * called loop-page.php and that will be used instead.
                        */
    
                        $avia_config['size'] = avia_layout_class( 'main' , false) == 'entry_without_sidebar' ? '' : 'entry_with_sidebar';
                        get_template_part( 'includes/loop', 'page' );
                        ?>
    
    				<!--end content-->
    				</main>
    
    				<?php
    
    				//get the sidebar
    				$avia_config['currently_viewing'] = 'page';
    				//get_sidebar();
    
    				?>
    
    			</div><!--end container-->
    
    		</div><!-- close default .container_wrap element -->
    
    <?php get_footer(); ?>

    Still got this annoying container or gray line appearing.
    https://www.verspeeten.com/VCTest/job/contracting-owner-operators/

    Plugin Author Mike Jolley

    (@mikejolley)

    You could remove it with CSS, or ask the author if you can change it in the template file. This line looks related:

    $avia_config['size'] = avia_layout_class( 'main' , false) == 'entry_without_sidebar' ? '' : 'entry_with_sidebar';

    Maybe try changing that to:

    $avia_config['size'] = '';

    Cannot guarantee it will work though, never used avia theme.

    Thread Starter tylererdie

    (@tylererdie)

    Looking like its<main class=’template-page content <?php avia_layout_class( ‘content’ ); ?> units’ <?php avia_markup_helper(array(‘context’ => ‘content’,’post_type’=>’page’));?>>`

    that removes the gray line

    this is a start. btw the theme is called Enfold.

    Thread Starter tylererdie

    (@tylererdie)

    So what If I wanted a different sidebar for the “job” section how would that be accomplished?

    Plugin Author Mike Jolley

    (@mikejolley)

    Well, in a normal theme you’d pass an argument to https://codex.www.ads-software.com/Function_Reference/get_sidebar

    E.g.

    <?php get_sidebar( 'custom' ); ?>

    Then you’d be able to use a separate sidebar file. Not sure if thats the same in this theme. This is kinda beyond the support for job manager though – none of this is plugin related ??

    Thread Starter tylererdie

    (@tylererdie)

    noticed when using single-job_listing.php that the “Share this entry” is removed.

    Plugin Author Mike Jolley

    (@mikejolley)

    Then you need to find our what outputs “Share this entry” and whether or not it supports custom post types (jobs are a custom post type).

    Thread Starter tylererdie

    (@tylererdie)

    Thread Starter tylererdie

    (@tylererdie)

    Last question how do you remove RSS from jobs page.

    Plugin Author Mike Jolley

    (@mikejolley)

Viewing 15 replies - 1 through 15 (of 27 total)
  • The topic ‘Sidebar on pages.’ is closed to new replies.