Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // add CPT to pojo posts archive
- function pojo_taxonomies_job_offers() {
- function pojo_add_post_type_to_smart_page_job_offers( $post_types = array() ) {
- $post_types[] = 'job_offers';
- return $post_types;
- }
- add_filter( 'pf_format_content_list', 'pojo_add_post_type_to_smart_page_job_offers' );
- function pojo_smart_page_add_fields_job_offers( $fields = array() ) {
- $cpt = 'job_offers';
- $fields[] = array(
- 'id' => 'content',
- 'type' => Pojo_MetaBox::FIELD_HIDDEN,
- 'std' => $cpt,
- );
- // If you want filter by Taxonomy
- $fields[] = array(
- 'id' => 'taxonomy',
- 'type' => Pojo_MetaBox::FIELD_HIDDEN,
- 'std' => 'field-of-work',
- );
- $fields[] = array(
- 'id' => 'taxonomy_terms',
- 'title' => __( 'Choose Category', 'pojo' ),
- 'type' => Pojo_MetaBox::FIELD_TAXONOMY_TERM_CHECKBOX,
- 'taxonomy' => 'field-of-work',
- );
- $fields[] = array(
- 'id' => 'display_type',
- 'title' => __( 'Select Content Layout', 'pojo' ),
- 'type' => Pojo_MetaBox::FIELD_SELECT,
- 'options' => array(
- '' => __( 'Default', 'pojo' ),
- 'gallery_grid_3' => __( 'Grid 3', 'pojo' ),
- 'list' => __( 'list', 'pojo' ),
- ),
- 'std' => '',
- );
- //extra fields
- /*$fields[] = array(
- 'id' => 'gallery_advanced_settings',
- 'title' => __( 'Advanced Settings', 'pojo' ),
- 'type' => Pojo_MetaBox::FIELD_BUTTON_COLLAPSE,
- );*/
- $fields[] = array(
- 'id' => 'posts_per_page_mode',
- 'title' => __( 'Galleries Per Page', 'pojo' ),
- 'type' => Pojo_MetaBox::FIELD_SELECT,
- 'classes' => array( 'select-show-or-hide-fields' ),
- 'options' => array(
- '' => __( 'Default', 'pojo' ),
- 'custom' => __( 'Custom', 'pojo' ),
- ),
- 'std' => '',
- );
- $fields[] = array(
- 'id' => 'posts_per_page',
- 'title' => __( 'Number Galleries', 'pojo' ),
- 'std' => get_option( 'posts_per_page' ),
- 'show_on' => array( 'po_posts_per_page_mode' => 'custom' ),
- );
- $fields[] = array(
- 'id' => 'order_by',
- 'title' => __( 'Order By', 'pojo' ),
- 'type' => Pojo_MetaBox::FIELD_SELECT,
- 'options' => array(
- '' => __( 'Date', 'pojo' ),
- 'menu_order' => __( 'Menu Order', 'pojo' ),
- 'title' => __( 'Title', 'pojo' ),
- 'rand' => __( 'Random', 'pojo' ),
- ),
- 'std' => '',
- );
- $fields[] = array(
- 'id' => 'order',
- 'title' => __( 'Order', 'pojo' ),
- 'type' => Pojo_MetaBox::FIELD_SELECT,
- 'options' => array(
- '' => __( 'DESC', 'pojo' ),
- 'ASC' => __( 'ASC', 'pojo' ),
- ),
- 'std' => '',
- );
- $fields[] = array(
- 'id' => 'offset',
- 'title' => __( 'Offset', 'pojo' ),
- 'std' => 0,
- 'desc' => __( 'Number of post to displace or pass over', 'pojo' ),
- );
- $fields[] = array(
- 'id' => 'pagination',
- 'title' => __( 'Pagination', 'pojo' ),
- 'type' => Pojo_MetaBox::FIELD_SELECT,
- 'options' => po_get_theme_pagination_support(),
- 'std' => '',
- );
- $fields[] = array(
- 'id' => 'gallery_advanced_settings',
- 'title' => __( 'Advanced Settings', 'pojo' ),
- 'type' => Pojo_MetaBox::FIELD_BUTTON_COLLAPSE,
- 'mode' => 'end',
- );
- return $fields;
- }
- add_filter( 'pf_list_posts_cpt-job_offers', 'pojo_smart_page_add_fields_job_offers' );
- }
- add_action( 'init', 'pojo_taxonomies_job_offers', 0 );
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement