Matador Jobs Shortcodes

Matador Jobs provides a number of “shortcodes” for our users to simply add functionality to their pages from the WordPress Classic Editor, WordPress Block Editor, or various page builder plugins. Shortcodes are like placeholders in your editor for Matador to insert code when the page is generated for the user.

The Anatomy of a Shortcode

Shortcodes are simple to use. Shortcodes are sometimes as easy as typing the name of the shortcode enclosed by square brackets [ and ], which are located next to the P key on your standard keyboard. Sometimes a shortcode has two words in its name, and when it does, the words are separated by an underscore _, which you type by holding shift and then the dash key - (next to the 0). A shortcode might look a lot like these examples:

[shortcode]

[another_shortcode]

Shortcodes can have parameters (also called arguments). These are extra instructions provided by the user to the shortcode to help it do exactly what the user wants. Parameters are separated from the shortcode name and each other by spaces, and each contain a rule name followed by an equals = sign followed by the rule value. Rule values must be enclosed in either double " or single ' quotes when they contain spaces, though you can include them always if you want. Here are some examples:

[shortcode parameter=value]

[another_shortcode parameter_1="value" parameter_2="value with spaces"]

Often, shortcode parameters are optional. When omitted, the default will be used. So if you’re using a default value, you can save yourself some keystrokes by omitting the parameter altogether.

How to Use a Shortcode

Shortcodes in the “Block Editor”

The WordPress “Block Editor” known also by its former development code-name Gutenberg Editor is the new WordPress page and post editor. Our shortcodes work in the Block Editor via the “Shortcode” block. Here is how:

  1. Press Enter or Return to start a new block.
  2. Type a forward-slash / to bring up block search.
  3. Begin typing the word “shortcode”. When the search finds the “Shortcode block” arrow-down or click on it.
  4. In the space provided, type our your desired Matador Jobs shortcode.

Shortcodes in “Widgets”

Shortcodes work only in the “Text” widget. Add a “Text” widget to your widget area and type the Shortcode you’d like to use.

Shortcodes in “Classic Editor”

Its easy to include WordPress Classic Editor… just type your Shortcode! No really, its that easy!

Shortcodes in “Page Builders” including Elementor, Divi, and WPBakery

In almost all cases, including a shortcode in the 3rd-party WordPress “page builder” is easy but you should consult the online documentation for your 3rd-party page builder for specific instructions.

The Matador Jobs Shortcodes

Now that we know what a shortcode is and how to use it, lets get into the Matador Jobs Shortcodes:

[matador_job]

This shortcode displays one job. It is useful to highlight a job in a blog post or to show a single random job in a sidebar.

Parameters

  • show: Use ‘newest’ for most recently added job, ‘random’ for any random job, or the WordPress ID number of a job to show that exact job. Default is ‘newest’.
  • no_wrapper: This a true or false parameter. Provide true or 1 to leave out an HTML wrapper markup. The wrapper is helpful for designers to specifically style these jobs. Default is ‘false’.
  • excerpt_length: Provide a whole number to designate how many words of the description should be shown before the user must click on “See Job”. Default is 160.
  • class: Provide a string to add a class name to the wrapper. Also helpful for designers to style these jobs. Default is empty.

Examples

Show the newest job, with wrapper, no class, 160 word excerpt:

[matador_job]

Show a random job, with wrapper, with class ‘random-job’, and 100 word excerpt:

[matador_job show=random class=random-job excerpt_length=100]

[matador_jobs]

This shortcode displays a list of jobs and paginates the list if needed. It is the most common shortcode, and is used to display jobs for all sites that do not use an archive template.

Parameters

  • as: Select the type/format of the job list. Accepts ‘listing’ for blocks of jobs stacked on top of each other, ‘list’ for an unordered list of links to jobs using the job title as the link text, ‘select’ for a drop down form field of job titles, and ‘table’ for an HTML table of job properties. Default is ‘listing’.
  • fields: List of fields to show, separated by commas. Accepts ‘title’, ‘content’, ‘excerpt’, ‘link’ for a link to the job, all valid job taxonomies, including ‘category’ and ‘location’, and all custom fields. When ‘as’ is ‘list’ or ‘select’, this is ignored. When ‘as’ is ‘table’, the table column headers are the name of field capitalized, but can be renamed by passing a pipe | character and then a label, ie: category|Industry would result in a table with a column heading of “Industry” that displays the value of the category taxonomy.

If your labels contain a space, make sure the entire value is wrapped in quotation marks, ie: fields="title|Job Title, content|Job Description, 'link|Learn More".

  • content_limit: Limit the length of the ‘content’ field output. Accepts ‘full’ for the whole job description, ‘excerpt’ for only the site default excerpt limit, or a whole number representing the number of words to show before truncation. Ignored when ‘as’ is ‘list’ or ‘select’. Default is 240.
  • jobs_per_page: How many jobs to show per page. If there are more total jobs than shown, pagination links will be added. Accepts any positive integer or -1 to show all jobs (use with caution). Defaults to 100 when ‘as’ is ‘list’ or ‘select’, 25 when ‘as’ is ‘table’, and 12 when ‘as’ is not set or ‘listing’.
  • backfill: Minimum number of jobs to show. When this shortcode is used to present related jobs, for example, if no jobs are related, the space can be “backfilled” with extra jobs so the section isn’t empty. Will ensure some jobs are shown even when no jobs fit the query. Accepts any positive integer or null/not set to disable backfill. Default is null/not set. If ‘backfill’ is greater than ‘jobs_per_page’, ‘backfill’ will be changed to ‘jobs_per_page’.
  • paginate: Whether to show pagination when the query can produce more results than ‘jobs_per_page’. Default is true. Pass false or 0 to disable pagination. If including jobs in a sidebar or related posts section, you should disable pagination.
  • search: Limits jobs to the specified search term, which will search title and content (job description). Default is null/not set.

‘search’ is a common argument to include spaces, and remember, shortcode parameter values with spaces must be enclosed by quotations.

  • $taxonomy: Any registered job taxonomy, of which ‘category’ and ‘location’ are default, each can be passed an argument. Accepted values are a string of taxonomy term IDs or URL slugs. For example, to show jobs only from the Categories ‘Administrative’ or ‘Human Resources’, you’d add category=administrative,human-resources.

There is no argument $taxonomy. ‘$taxonomy’ is a placeholder for the Matador Jobs taxonomy names. Passing an argument of $taxonomy will not affect the output of the shortcode.

  • selected: Determines which options are selected when ‘as’ is ‘select’. Accepts an integer WordPress ID or list of comma-separated WordPress Job IDs. Do not pass Bullhorn Job IDs. Default is the value of the URL Query String or not set/null.
  • multi: When ‘as’ is ‘select’, determines whether the drop-down also multiple selections. Pass 1 or true to enable. Defaults to false.
  • id: Set an HTML id value for the job wrapper. Defaults to not set/null.
  • class: Provide a string to add a class name to the wrapper. Also helpful for designers to style these jobs. Default is not set/null.

Examples

The default shortcode displays the 12 most recent jobs, with the fields title, meta, content, and link, with pagination to see more, in a ‘listing’ layout:

[matador_jobs]

Show the 3 most recent jobs from the “Administrative” category, but backfill if there are no jobs in the category, with the fields title, meta, content, and link, without pagination, in a ‘listing’ layout:

[matador_jobs category=administrative pagination=false jobs_per_page=3 backfill=3]

Show a bullet list of the 5 newest jobs in the location of “Arizona” without pagination:

[matador_jobs as=list location=arizona jobs_per_page=5 pagination=false]

Show a table of jobs with the title labeled “Job Title”, location labelled “Location”, and link labelled “See More”, and show 25 results.

[matador_jobs as=table fields="title|Job Title, location, link|See More"]

[matador_jobs_list], [matador_jobs_table], [matador_jobs_listing]

These are shortcut shortcodes that do everything as [matador_jobs] but presets some of the arguments for simplicity.

Parameters

See [matador_jobs] for a list of parameters and how they work.

Examples

Displays the 12 most recent jobs, with the fields title, meta, content, and link, with pagination to see more, in a ‘listing’ layout:

[matador_jobs]

Show the 3 most recent jobs from the “Administrative” category, but backfill if there are no jobs in the category, with the fields title, meta, content, and link, without pagination, in a ‘listing’ layout:

[matador_jobs_listing category=administrative pagination=false jobs_per_page=3 backfill=3]

Show a bullet list of the 5 newest jobs in the location of “Arizona” without pagination:

[matador_jobs_list location=arizona jobs_per_page=5 pagination=false]

Show a table of jobs with the title labeled “Job Title”, location labelled “Location”, and link labelled “See More”, and show 25 results.

[matador_jobs_table fields="title|Job Title, location, link|See More"]
Updated on April 23, 2021

Was this article helpful?

Related Articles