• Resolved Joseph

    (@tetradon4)


    Hi everybody, I’m in desperate need of help, a huge thank you in advance to anyone who could be so kind to help me, unfortunately I cannot code in php.

    I have several pages where I display listings with these shortcodes (example):

    Page about Category01

    [jobs categories=category01-top show_filters=false orderby=rand]
    [jobs categories=category01-mid show_filters=false orderby=rand]
    [jobs categories=category01-low show_filters=false orderby=rand]

    so I have a page about Category01 where I show listing ordered on 3 tiers:

    – listings belonging to “category01-top” are top tier and appear first
    – listings belonging to “category01-mid” are mid tier and appear second
    – listings belonging to “category01-low” are low tier and appear last

    I need to style differently the listings belonging to each category so:

    “category01-top” with its own column ( col-xs-12 col-sm-12 col-md-12 )
    “category01-mid” with its own column ( col-xs-12 col-sm-6 col-md-6 )
    “category01-low” with its own column ( col-xs-6 col-sm-6 col-md-4 )

    How can I do this?

    It looks like this is written in this file:

    themes/mytheme/inc/integrations/wp-job-manager/class-wp-job-manager-template.php

    in this piece of code:

        public function get_grid_columns( $style = false ) {
            global $listify_job_manager, $wp_query;
    
            if ( 'list' == $style ) {
                return apply_filters( 'listify_list_columns', 'col-xs-12' );
            }
    
            if ( 
    			( 
    				in_array( $listify_job_manager->map->template->position(), array( 'side', 'right' ) ) ||
    				in_array( get_theme_mod( 'listing-archive-facetwp-position', 'side' ), array( 'side' ) ) ||
    				is_active_sidebar( 'archive-job_listing' )
    			) &&
    			! ( is_front_page() || listify_is_widgetized_page() )
            ) {
                $cols = apply_filters( 'listify_grid_columns_sidebar', 'col-xs-12 col-sm-6' );
            } else {
                $cols = apply_filters( 'listify_grid_columns_no_sidebar', 'col-xs-12 col-sm-6 col-md-4' );
            }
    
            return $cols;
        }

    I guess I have to modify this to work this way:

    for every job listing category that has the word “top” in its name or slug, use this grid: col-xs-12 col-sm-12 col-md-12

    for every job listing category that has the word “mid” in its name or slug, use this grid: col-xs-12 col-sm-6 col-md-6

    for every job listing category that has the word “low” in its name or slug, use this grid: col-xs-6 col-sm-6 col-md-4

    Unfortunately I’m a noob at coding, I would really appreciate if someone could help me out, thank you so much for your support.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to style selected categories differently’ is closed to new replies.