Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions environments/jobs/bin/after-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,30 @@ $WP wp rewrite structure '/%postname%/' --hard
# Activate the jobswp theme.
$WP wp theme activate jobswp

# Remove default widgets to match production (sidebar only has the hardcoded Position Types list).
echo "Clearing default sidebar widgets..."
$WP wp widget reset sidebar-1 > /dev/null 2>&1 || true

# Create pages that exist on jobs.wordpress.net (if they don't already exist).
echo "Creating pages..."
$WP wp post create --post_type=page --post_status=publish --post_title='Post a Job' --post_name='post-a-job' --porcelain > /dev/null 2>&1 && echo " Created page: /post-a-job/" || true
$WP wp post create --post_type=page --post_status=publish --post_title='Remove a Job' --post_name='remove-a-job' --porcelain > /dev/null 2>&1 && echo " Created page: /remove-a-job/" || true
create_page_if_missing() {
local slug="$1"
local title="$2"
local content="${3:-}"
EXISTING=$($WP wp post list --post_type=page --name="$slug" --format=count 2>/dev/null)
if [ "$EXISTING" -gt 0 ] 2>/dev/null; then
echo " Page /$slug/ already exists, skipping..."
else
if [ -n "$content" ]; then
$WP wp post create --post_type=page --post_status=publish --post_author=1 --post_title="$title" --post_name="$slug" --post_content="$content" --porcelain > /dev/null 2>&1 && echo " Created page: /$slug/" || true
else
$WP wp post create --post_type=page --post_status=publish --post_author=1 --post_title="$title" --post_name="$slug" --porcelain > /dev/null 2>&1 && echo " Created page: /$slug/" || true
fi
fi
}
create_page_if_missing 'post-a-job' 'Post a Job'
create_page_if_missing 'remove-a-job' 'Remove a Job'
create_page_if_missing 'faq' 'FAQ' '<h2>General</h2><dl><dt>What is this site?</dt><dd>This is a job board for WordPress-related jobs. Anyone can post a job opening or browse available positions.</dd><dt>How long do job postings stay up?</dt><dd>Job postings remain active for 21 days from the date of approval, after which they are automatically removed.</dd><dt>How much does it cost to post a job?</dt><dd>Posting a job is completely free.</dd></dl><h2>For Employers</h2><dl><dt>What kinds of jobs can I post?</dt><dd>Any job that is directly related to WordPress. This includes development, design, support, writing, translation, and more.</dd><dt>What is NOT acceptable for a job posting?</dt><dd>Jobs that are not related to WordPress, jobs that require payment from applicants, and jobs offering illegally low compensation are not acceptable.</dd><dt>How do I remove my job posting?</dt><dd>When you submit a job, you receive a job token. Use that token on the Remove a Job page to remove your listing at any time.</dd></dl>'

# Create job categories.
echo "Creating job categories..."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 +100,15 @@ function jobswp_archive_header( $before = '', $after = '', $jobscnt = 0, $catego

$link .= " <span class='posts-count'>($orig_jobscnt)</span> $after";
$output .= $link;
$output .= '<div class="grid_2 omega jobs-count">';
$output .= '<div class="jobs-count">';

$output .= '<a href="' . $feed_link . '"><div class="dashicons dashicons-rss"></div></a><span>' . $jobscnt . '</span></div>
$output .= '<a href="' . $feed_link . '">RSS</a> <span>' . $jobscnt . '</span></div>
</div>
<div class="clear"></div>
<div class="row job-list-col-labels">
<div class="job-date grid_2 alpha">Date Posted</div>
<div class="job-title grid_4">Job Title</div>
<div class="job-type grid_1 alpha omega">Job Type</div>
<div class="job-location grid_2 omega">Location</div>
<div class="clear"></div>
<div class="job-date">Date Posted</div>
<div class="job-title">Job Title</div>
<div class="job-type">Job Type</div>
<div class="job-location">Location</div>
</div>';

echo $output;
Expand Down
31 changes: 14 additions & 17 deletions jobs.wordpress.net/public_html/wp-content/themes/jobswp/404.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,19 @@

get_header(); ?>

<?php get_sidebar(); ?>
<main>
<section class="no-results not-found" style="text-align:center; padding: 80px 20px;">
<header class="page-header">
<h1 class="page-title"><?php esc_html_e( 'Oops! That page can&rsquo;t be found.', 'jobswp' ); ?></h1>
</header>

<div id="primary" class="content-area grid_9">
<main id="main" class="site-main" role="main">
<div class="page-content">
<p><?php esc_html_e( 'It looks like nothing was found at this location. Maybe try a search?', 'jobswp' ); ?></p>
<div style="max-width:400px; margin: 20px auto;">
<?php get_search_form(); ?>
</div>
</div>
</section>
</main>

<section class="error-404 not-found">
<header class="page-header">
<h1 class="page-title"><?php _e( 'Oops! That page can&rsquo;t be found.', 'jobswp' ); ?></h1>
</header><!-- .page-header -->

<div class="page-content">
<p><?php _e( 'It looks like nothing was found at this location. Maybe try using the search form above?', 'jobswp' ); ?></p>
</div><!-- .page-content -->
</section><!-- .error-404 -->

</main><!-- #main -->
</div><!-- #primary -->

<?php get_footer(); ?>
<?php get_footer(); ?>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
$category = get_term( $q->term_id, $q->taxonomy );

jobswp_archive_header(
'<div class="job-list-head grid_7 alpha"><h2 class="job-cat-item job-cat-item-' . esc_attr( $category->slug ) . '">',
'<div class="job-list-head"><h2 class="job-cat-item job-cat-item-' . esc_attr( $category->slug ) . '">',
'</h2></div>',
$category->count,
$category
Expand Down
171 changes: 139 additions & 32 deletions jobs.wordpress.net/public_html/wp-content/themes/jobswp/content-home.php
Original file line number Diff line number Diff line change
@@ -1,44 +1,151 @@
<?php
global $category;
/**
* Homepage template — hero, filters, and job cards grid.
*
* @package jobswp
*/

$job_categories = Jobs_Dot_WP::get_job_categories();

if ( $job_categories ) :
// Collect all published jobs across categories.
$all_jobs = array();
$category_map = array(); // job ID => category slug
$total_jobs = 0;
$remote_count = 0;
$categories_with_jobs = 0;

// Groups jobs according to job category.
foreach ( $job_categories as $i => $category ) {
$job_category_jobs[ $category->slug ] = Jobs_Dot_WP::get_jobs_for_category( $category );
$latest_post = $job_category_jobs[ $category->slug ][0];
// Add key for sorting.
$job_categories[ $i ]->latest_post_date = $latest_post ? $latest_post->post_date : '0';
}

// Sort job categories according to recency of latest post.
$job_categories = wp_list_sort( $job_categories, [ 'latest_post_date' => 'DESC', 'name' => 'ASC' ] );

// Display the categories and their jobs.
foreach ( $job_categories as $category ) {
$posts = $job_category_jobs[ $category->slug ];
if ( $job_categories ) {
foreach ( $job_categories as $job_cat ) {
$jobs = Jobs_Dot_WP::get_jobs_for_category( $job_cat );
if ( ! empty( $jobs ) ) {
$categories_with_jobs++;
foreach ( $jobs as $job ) {
if ( ! isset( $category_map[ $job->ID ] ) ) {
$all_jobs[] = $job;
$category_map[ $job->ID ] = $job_cat->slug;
$total_jobs++;

//Display the name of the category, whether there are jobs or not
echo '<div class="jobs-group">';
$location = get_post_meta( $job->ID, 'location', true );
if ( empty( $location ) || 'N/A' === $location || stripos( $location, 'remote' ) !== false || stripos( $location, 'anywhere' ) !== false ) {
$remote_count++;
}
}
}
}
}
}

jobswp_archive_header(
'<div class="job-list-head grid_7 alpha"><h2 class="job-cat-item job-cat-item-' . esc_attr( $category->slug ) . '">',
'</h2></div>',
$category->count,
$category
);
$remote_pct = $total_jobs > 0 ? round( ( $remote_count / $total_jobs ) * 100 ) : 0;
?>

get_template_part( 'content', 'list' );
<!-- Hero Section -->
<section class="hero">
<div class="hero__inner">
<h1>
<?php
printf(
/* translators: %s: highlighted word "Opportunity" */
esc_html__( 'Find Your Next WordPress %s', 'jobswp' ),
'<span class="hero__highlight">' . esc_html__( 'Opportunity', 'jobswp' ) . '</span>'
);
?>
</h1>
<p><?php esc_html_e( 'Browse open positions across the WordPress ecosystem — from development to design, support to community.', 'jobswp' ); ?></p>
<div class="hero__actions">
<a href="#jobs" class="btn btn-primary"><?php esc_html_e( 'Browse Jobs', 'jobswp' ); ?></a>
<a href="<?php echo esc_url( home_url( '/post-a-job/' ) ); ?>" class="btn btn-outline"><?php esc_html_e( 'Post a Job', 'jobswp' ); ?></a>
</div>
<div class="hero__stats">
<div class="hero__stat">
<span class="hero__stat-number"><?php echo esc_html( $total_jobs ); ?></span>
<span class="hero__stat-label"><?php esc_html_e( 'Open Positions', 'jobswp' ); ?></span>
</div>
<div class="hero__stat">
<span class="hero__stat-number"><?php echo esc_html( $categories_with_jobs ); ?></span>
<span class="hero__stat-label"><?php esc_html_e( 'Categories', 'jobswp' ); ?></span>
</div>
<div class="hero__stat">
<span class="hero__stat-number"><?php echo esc_html( $remote_pct . '%' ); ?></span>
<span class="hero__stat-label"><?php esc_html_e( 'Remote Friendly', 'jobswp' ); ?></span>
</div>
</div>
</div>
</section>

echo "</div>\n";
}
<!-- Filter Pills -->
<section class="filters" id="jobs">
<p class="filters__label"><?php esc_html_e( 'Filter by category', 'jobswp' ); ?></p>
<div class="filters__pills">
<button class="filter-pill active" data-category="all"><?php esc_html_e( 'All', 'jobswp' ); ?></button>
<?php if ( $job_categories ) : ?>
<?php foreach ( $job_categories as $job_cat ) : ?>
<button class="filter-pill" data-category="<?php echo esc_attr( $job_cat->slug ); ?>"><?php echo esc_html( $job_cat->name ); ?></button>
<?php endforeach; ?>
<?php endif; ?>
</div>
</section>

else : // Else no job categories defined.
<!-- Job Cards Grid -->
<section class="jobs-section">
<div class="jobs-grid">
<?php if ( ! empty( $all_jobs ) ) : ?>
<?php foreach ( $all_jobs as $job ) : ?>
<?php
$cat_slug = isset( $category_map[ $job->ID ] ) ? $category_map[ $job->ID ] : '';
$cat_term = get_term_by( 'slug', $cat_slug, 'job_category' );
$cat_name = $cat_term ? $cat_term->name : '';
$company = get_post_meta( $job->ID, 'company', true );
$location = get_post_meta( $job->ID, 'location', true );
$jobtype = jobswp_get_job_meta( $job->ID, 'jobtype' );

echo '<div class="jobs-group">';
echo '<div class="job-list-head grid_7 alpha"><h2 class="job-cat-item">' . __( 'No job categories defined.', 'jobswp' ) . '</h2></div>';
echo "</div>\n";
$is_remote = empty( $location ) || 'N/A' === $location || stripos( $location, 'remote' ) !== false || stripos( $location, 'anywhere' ) !== false;
$location_display = $is_remote ? __( 'Remote', 'jobswp' ) : $location;
$location_icon = $is_remote ? '&#127758;' : '&#128205;';

endif;
$type_icon = '&#128188;';
if ( 'Contract' === $jobtype || 'Project' === $jobtype ) {
$type_icon = '&#128196;';
} elseif ( 'Part Time' === $jobtype ) {
$type_icon = '&#9201;';
}
?>
<a href="<?php echo esc_url( get_permalink( $job->ID ) ); ?>" class="job-card" data-category="<?php echo esc_attr( $cat_slug ); ?>">
<?php if ( $cat_name ) : ?>
<span class="job-card__badge"><?php echo esc_html( $cat_name ); ?></span>
<?php endif; ?>
<h2 class="job-card__title"><?php echo esc_html( get_the_title( $job->ID ) ); ?></h2>
<?php if ( $company ) : ?>
<p class="job-card__company"><?php echo esc_html( $company ); ?></p>
<?php endif; ?>
<div class="job-card__meta">
<span><?php echo wp_kses( $location_icon, array() ) . ' ' . esc_html( $location_display ); ?></span>
<?php if ( $jobtype && 'N/A' !== $jobtype ) : ?>
<span><?php echo wp_kses( $type_icon, array() ) . ' ' . esc_html( $jobtype ); ?></span>
<?php endif; ?>
</div>
<p class="job-card__date">
<?php
printf(
/* translators: %s: date the job was posted */
esc_html__( 'Posted %s', 'jobswp' ),
esc_html( get_the_date( 'F j, Y', $job->ID ) )
);
?>
</p>
</a>
<?php endforeach; ?>
<?php else : ?>
<div class="jobs-empty">
<p>
<?php
printf(
/* translators: %s: URL to post a job */
wp_kses_post( __( 'No jobs are currently posted. Would you like to <a href="%s">post a job</a>?', 'jobswp' ) ),
esc_url( home_url( '/post-a-job/' ) )
);
?>
</p>
</div>
<?php endif; ?>
</div>
</section>
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
$evenodd = abs( $evenodd - 1 );
echo '<div class="row row-'. $evenodd . '">';

echo '<div class="job-date grid_2 alpha">' . get_the_date( 'M j' ) . '</div>';
echo '<div class="job-title grid_4">';
echo '<div class="job-date">' . get_the_date( 'M j' ) . '</div>';
echo '<div class="job-title">';
echo '<a href="'; the_permalink(); echo '" rel="bookmark">'; the_title(); echo '</a></div>';
echo '<div class="job-type grid_1 alpha omega">';
echo '<div class="job-type">';
echo jobswp_get_job_meta( get_the_ID(), 'jobtype' );
echo '</div>';
echo '<div class="job-location grid_2 omega">';
echo '<div class="job-location">';
echo jobswp_get_job_meta( get_the_ID(), 'location' );
echo '</div>';
echo '</div>';

echo '<div class="clear"></div>';
echo '</div>';
Expand All @@ -25,7 +25,7 @@
} // End if posts
else {
echo '<div class="row row-1">';
echo "<div class='no-job grid_9'>";
echo "<div class='no-job'>";
echo sprintf(
__( 'There are no jobs in this category. If you\'re hiring, you can <a href="%s">post a new job</a>.', 'jobswp' ),
'/post-a-job'
Expand All @@ -34,14 +34,15 @@
echo '</div>';
}
?>
</ul>

<?php
<?php
if ( is_front_page() ) {
global $category;
echo '<p class="all-job-categories">';
if ( ! $category )
$category = array_pop( get_the_terms( get_the_ID(), 'job_category') );
if ( ! $category ) {
$terms = get_the_terms( get_the_ID(), 'job_category' );
$category = $terms ? array_pop( $terms ) : null;
}

$link = '';
$link .= '<a href="' . esc_attr( get_term_link( $category, 'job_category' ) ) . '" ';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
) );
?>

<?php edit_post_link( __( 'Edit', 'jobswp' ), '<footer class="entry-meta grid_9"><span class="edit-link">', '</span></footer>' ); ?>
<?php edit_post_link( __( 'Edit', 'jobswp' ), '<footer class="entry-meta"><span class="edit-link">', '</span></footer>' ); ?>
</div><!-- .entry-content -->
</article><!-- #post-## -->

Expand Down
Loading
Loading