コード例 #1
0
ファイル: extras.php プロジェクト: swaroop42/RockRose
/**
 * Adds custom classes to the array of body classes.
 *
 * @param array $classes Classes for the body element.
 *
 * @return array
 */
function listable_body_classes($classes)
{
    // Adds a class of group-blog to blogs with more than 1 published author.
    if (is_multi_author()) {
        $classes[] = 'group-blog';
    }
    global $post;
    if (has_nav_menu('secondary')) {
        $classes[] = 'has--secondary-menu';
    }
    if (isset($post->post_content) && has_shortcode($post->post_content, 'jobs') || is_search() || is_tax(array('job_listing_category', 'job_listing_tag', 'job_listing_region'))) {
        $classes[] = 'page-listings';
    }
    if (isset($post->post_content) && has_shortcode($post->post_content, 'job_dashboard')) {
        $classes[] = 'page-job-dashboard';
    }
    if (isset($post->post_content) && has_shortcode($post->post_content, 'my_bookmarks')) {
        $classes[] = 'page-my-bookmarks';
    }
    if (isset($post->post_content) && has_shortcode($post->post_content, 'woocommerce_my_account')) {
        $classes[] = 'page-login';
    }
    if (isset($post->post_content) && has_shortcode($post->post_content, 'submit_job_form')) {
        $classes[] = 'page-add-listing';
    }
    if (listable_using_facetwp()) {
        $classes[] = 'is--using-facetwp';
    }
    if (isset($post->post_content) && has_shortcode($post->post_content, 'jobs_by_tag')) {
        $classes[] = 'jobs-by-tags-page';
    }
    return $classes;
}
コード例 #2
0
ファイル: functions.php プロジェクト: swaroop42/RockRose
/**
 * Enqueue scripts and styles.
 */
function listable_scripts()
{
    $theme = wp_get_theme();
    //if there is no mapbox token use Google Maps instead
    if ('' == listable_get_option('mapbox_token', '')) {
        wp_deregister_script('google-maps');
        wp_enqueue_script('google-maps', '//maps.google.com/maps/api/js?v=3.exp&libraries=places', array(), '3.22', true);
        $listable_scripts_deps[] = 'google-maps';
    } elseif (wp_script_is('google-maps') || listable_using_facetwp()) {
        wp_deregister_script('google-maps');
        wp_enqueue_script('google-maps', '//maps.google.com/maps/api/js?v=3.exp&libraries=places', array(), '3.22', false);
        $listable_scripts_deps[] = 'google-maps';
    }
    wp_deregister_style('wc-paid-listings-packages');
    wp_deregister_style('wc-bookings-styles');
    $main_style_deps = array();
    //only enqueue the de default font if Customify is not present
    if (!class_exists('PixCustomifyPlugin')) {
        wp_enqueue_style('listable-default-fonts', 'https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,300,600,700');
        $main_style_deps[] = 'listable-default-fonts';
    }
    if (!is_rtl()) {
        wp_enqueue_style('listable-style', get_template_directory_uri() . '/style.css', $main_style_deps, $theme->get('Version'));
    }
    if (class_exists('LoginWithAjax')) {
        wp_enqueue_style('listable-login-with-ajax', get_template_directory_uri() . '/assets/css/login-with-ajax.css', $main_style_deps, $theme->get('Version'));
    }
    global $post;
    $listable_scripts_deps = array('jquery');
    if (isset($post->post_content) && has_shortcode($post->post_content, 'jobs') && true === listable_jobs_shortcode_get_show_map_param($post->post_content) || is_single() && 'job_listing' == $post->post_type || is_search() || isset($post->post_content) && is_archive() && 'job_listing' == $post->post_type || is_tax(array('job_listing_category', 'job_listing_tag', 'job_listing_region')) || isset($post->post_content) && has_shortcode($post->post_content, 'submit_job_form')) {
        wp_enqueue_script('leafletjs', get_template_directory_uri() . '/assets/js/plugins/leaflet.js', array('jquery'), '1.0.0', true);
        $listable_scripts_deps[] = 'leafletjs';
    }
    wp_enqueue_script('listable-scripts', get_template_directory_uri() . '/assets/js/main.js', $listable_scripts_deps, $theme->get('Version'), true);
    if (is_singular() && comments_open() && get_option('thread_comments')) {
        wp_enqueue_script('comment-reply');
    }
    wp_localize_script('listable-scripts', 'listable_params', array('login_url' => rtrim(esc_url(wp_login_url()), '/'), 'strings' => array('wp-job-manager-file-upload' => esc_html__('Add Photo', 'listable'), 'no_job_listings_found' => esc_html__('No results', 'listable'), 'results-no' => esc_html__('Results', 'listable'))));
}
コード例 #3
0
ファイル: job-filters.php プロジェクト: swaroop42/RockRose
<?php

/**
 * The template for displaying the WP Job Manager Filters
 *
 * @package Listable
 */
?>

<?php 
if (listable_using_facetwp()) {
    ?>

	<div class="job_filters">
		<div class="search_jobs">

		<?php 
    $facets = listable_get_facets_by_area('listings_archive_visible');
    $navigation_facets = listable_get_facets_by_area('navigation_bar');
    $all_facets = listable_get_all_facets();
    if (!empty($facets)) {
        foreach ($facets as $key => $facet) {
            foreach ($navigation_facets as $nav_facet) {
                //@todo we should do a little bit of sanity check here - if the facet actually exists
                if ($facet['name'] == $nav_facet['name']) {
                    unset($facets[$key]);
                }
            }
        }
        $facets = array_values($facets);
        listable_display_facets($facets);
コード例 #4
0
ファイル: wp-job-manager.php プロジェクト: swaroop42/RockRose
function listabe_filter_wp_jobs_manager_settings($args)
{
    /**
     * Now we are gone replace in all settings descriptions the "Job" with "Listing"
     */
    array_walk_recursive($args, 'listable_replace_jobs_with_listings');
    if (listable_using_facetwp()) {
        // add a facetwp options page
        $args['job_fwp'] = array(esc_html__('FacetWP', 'listable'), array(array('name' => 'listable_facets_config', 'label' => '', 'type' => 'fwp_drag_and_drop')));
    }
    return $args;
}