Below, you’ll find a detailed guide on how to add the Wp Job Openings Shortcode to your WordPress website, including its parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the Wp Job Openings Plugin shortcode not to show or not to work correctly.
Before starting, here is an overview of the Wp Job Openings Plugin and the shortcodes it provides:
"WP Job Openings is a comprehensive employment solution plugin. It simplifies job listing, provides a professional career page, and streamlines recruitment processes. Ideal for any WordPress site."
- [awsmjobs]
Wp Job Openings [awsmjobs] Shortcode
The wp-job-openings plugin shortcode ‘awsmjobs’ is used to display job listings on your website. The ‘awsm_jobs_shortcode’ function constructs the job listings based on specific attributes and defaults. It enables pagination, filter options, and the number of listings to display per page. The shortcode output content is then filtered and returned for display.
Shortcode: [awsmjobs]
Parameters
Here is a list of all possible awsmjobs shortcode parameters and attributes:
uid
– Unique identifier for each job listingfilters
– Determines whether job filters are enabled or notlistings
– Specifies the number of job listings per pageloadmore
– Enables the ‘Load More’ option for job listingspagination
– Sets the type of pagination for job listingsspecs
– Additional specifications for the job listings
Examples and Usage
Basic example – A simple shortcode usage to display job listings without any filters.
[awsmjobs]
With this basic shortcode, you can display the job listings on any page or post. It will display the jobs according to the default settings you’ve configured in the WP Job Openings settings. The shortcode doesn’t include any attributes or parameters, so it will show jobs without any specific filters.
Advanced examples
Display job listings with filters enabled.
[awsmjobs filters="yes"]
In this example, the shortcode includes the ‘filters’ attribute set to ‘yes’. This means the job listings will display with filters, allowing visitors to filter the jobs based on their preferences.
Display a specific number of job listings per page.
[awsmjobs listings="5"]
This shortcode includes the ‘listings’ attribute, which is set to ‘5’. This means that the page will display five job listings at a time. This can be useful if you want to limit the number of jobs displayed on a page to prevent it from becoming too long.
Display job listings with a modern pagination style.
[awsmjobs pagination="modern"]
This shortcode includes the ‘pagination’ attribute set to ‘modern’. This means the job listings will display with a modern-style pagination. This can be useful if you want to provide a more contemporary look and feel to your job listings page.
PHP Function Code
In case you have difficulties debugging what causing issues with [awsmjobs]
shortcode, check below the related PHP functions code.
Shortcode line:
add_shortcode( 'awsmjobs', array( $this, 'awsm_jobs_shortcode' ) );
Shortcode PHP function:
function awsm_jobs_shortcode( $atts ) {
if ( ! function_exists( 'awsm_jobs_query' ) ) {
return;
}
/**
* Filters the shortcode attributes and their defaults.
*
* @since 1.6.0
*
* @param array $pairs List of supported attributes and their defaults.
*/
$pairs = apply_filters(
'awsm_jobs_shortcode_defaults',
array(
'uid' => $this->unique_listing_id,
'filters' => get_option( 'awsm_enable_job_filter_listing' ) !== 'enabled' ? 'no' : 'yes',
'listings' => get_option( 'awsm_jobs_list_per_page' ),
'loadmore' => 'yes',
'pagination' => get_option( 'awsm_jobs_pagination_type', 'modern' ),
'specs' => '',
)
);
$shortcode_atts = shortcode_atts( $pairs, $atts, 'awsmjobs' );
$this->unique_listing_id++;
ob_start();
include self::get_template_path( 'job-openings-view.php' );
$content = ob_get_clean();
/**
* Filters the shortcode output content.
*
* @since 1.6.0
*
* @param string $content Shortcode content.
* @param array $shortcode_atts Combined and filtered shortcode attribute list.
*/
return apply_filters( 'awsm_jobs_shortcode_output_content', $content, $shortcode_atts );
}
Code file location:
wp-job-openings/wp-job-openings/wp-job-openings.php
Conclusion
Now that you’ve learned how to embed the Wp Job Openings Plugin shortcode, understood the parameters, and seen code examples, it’s easy to use and debug any issue that might cause it to ‘not work’. If you still have difficulties with it, don’t hesitate to leave a comment below.
Leave a Reply